Chart.js Test

Developer
Size
2,148 Kb
Views
14,168

How do I make an chart.js test?

What is a chart.js test? How do you make a chart.js test? This script and codes were developed by Valentin Treu on 20 December 2022, Tuesday.

Chart.js Test Previews

Chart.js Test - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Chart.js Test</title>
</head>
<body> <html> <head> <meta charset="utf-8" /> <title></title> <script data-require="jquery" data-semver="2.1.4" src="https://code.jquery.com/jquery-2.1.4.js"></script> <script src="charts2.0.js"></script> </head> <body> <canvas id="canvas"></canvas> <script> var barChartData = { labels: ["Mai 2015", "September 2015", "Mai 2016", "September 2016"], datasets: [ { label: "Punkte", type:'line', data: [130, 155, 145, 170], fill: false, borderColor: '#EC932F', backgroundColor: '#EC932F', pointBorderColor: '#EC932F', pointBackgroundColor: '#EC932F', pointHoverBackgroundColor: '#EC932F', pointHoverBorderColor: '#EC932F', yAxisID: 'y-axis-1' }, { type: 'line', showLine: false, label: "Platz", data: [51, 65, 40, 49], fill: false, backgroundColor: '#71B37C', borderColor: '#71B37C', hoverBackgroundColor: '#71B37C', hoverBorderColor: '#71B37C', pointBorderWidth: 1, pointHoverRadius: 10, pointHoverBackgroundColor: "rgba(75,192,192,1)", pointHoverBorderColor: "rgba(220,220,220,1)", pointHoverBorderWidth: 2, pointRadius: 10, pointHitRadius: 10, pointBackgroundColor: ['#EC932F', '#123123', '#555555', '#999999'], yAxisID: 'y-axis-2' } ] }; window.onload = function() { var ctx = document.getElementById("canvas").getContext("2d"); window.myBar = new Chart(ctx, { type: 'line', data: barChartData, options: { responsive: true, tooltips: { enabled: true, mode: 'single', callbacks: { label: function(item, data) { console.log(data); if (item.datasetIndex == 1) { return data.datasets[1].label + ': ' + item.yLabel + ' (Winners Group)'; } return data.datasets[0].label + ': ' + item.yLabel; } } }, elements: { line: { fill: false, tension: 0 } }, scales: { xAxes: [{ display: true, gridLines: { display: true }, labels: { show: true }, ticks: { beginAtZero: false }, position: "bottom" }], yAxes: [{ type: "linear", display: true, position: "left", id: "y-axis-1", gridLines:{ display: true }, labels: { show:true, } }, { type: "linear", display: true, position: "right", id: "y-axis-2", gridLines:{ display: false }, labels: { show:true, } }] } } }); }; </script> </body>
</html> <script src='https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.2.2/Chart.min.js'></script>
</body>
</html>
Chart.js Test - Script Codes
Chart.js Test - Script Codes
Home Page Home
Developer Valentin Treu
Username rivella50
Uploaded December 20, 2022
Rating 3
Size 2,148 Kb
Views 14,168
Do you need developer help for Chart.js Test?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Valentin Treu (rivella50) Script Codes
Create amazing web content with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!