xxxxxxxxxx
1
<canvas id="lineChart"></canvas>
1
1
xxxxxxxxxx
1
//line
2
var ctxL = document.getElementById("lineChart").getContext('2d');
3
var myLineChart = new Chart(ctxL, {
4
type: 'line',
5
data: {
6
labels: ["January", "February", "March", "April", "May", "June", "July"],
7
datasets: [{
8
label: "My First dataset",
9
data: [65, 59, 80, 81, 56, 55, 40],
10
backgroundColor: [
11
'rgba(105, 0, 132, 0)',
12
],
13
borderColor: [
14
'rgba(200, 99, 132, .7)',
15
],
16
borderWidth: 2
17
},
18
{
19
label: "My Second dataset",
20
data: [28, 48, 40, 19, 86, 27, 90],
21
backgroundColor: [
22
'rgba(0, 137, 132, 0)',
23
],
24
borderColor: [
25
'rgba(0, 10, 130, .7)',
26
],
27
borderWidth: 2
28
}
29
]
30
},
31
options: {
32
responsive: true
33
}
34
});
Console errors: 0