Chart.js
De Banane Atomic
Aller à la navigationAller à la recherche
Liens
Utilisation
<head> <script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.4.0/Chart.bundle.min.js"></script> <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script> </head> <body> <div style="width: 85%"> <canvas id="canvas"></canvas> </div> <script> var ctx = $("#canvas"); new Chart(ctx, { type: 'line', data: chartData, options: chartOptions }); </script> |
Chart Data
var chartData = { labels: ["Label1", "Label2"], datasets: [ { type: 'line', label: 'Dataset 1', borderColor: 'red', fill: false, data: [ 1, 2 ] }, { type: 'line', label: 'Dataset 2', borderColor: 'orange', fill: false, data: [ 5, 10 ] }] }; |