ChartJS Line Chart
Multiple Line Chart
by Leelenaleee
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.0.0-beta.10/chart.js"></script>
<body>
<canvas id="chartJSContainer" width="600" height="400"></canvas>
</body>
CSS
canvas { background-color : #eee;
}
JavaScript
var ctx = document.getElementById('chartJSContainer');
var myChart = new Chart(ctx, {
type: "line",
data: {
//labels: [0, 1, 2,3],
datasets: [
{
label: "System.CPU",
data: [
{ x: 0, y: 5 },
{ x: 1, y: 5 },
{ x: 2, y: 10 },
{ x: 3, y: 20 },
/*{ x: '0', y: 5 },
{ x: '1', y: 5 },
{ x: '2', y: 10 },
{ x: '3', y: 20 },*/
],
},
]
},
});