HTML
xxxxxxxxxx
1
<div class="container my-5">
2
3
<!-- Section: Block Content -->
4
<section>
5
6
<div class="card card-list">
7
<div class="card-header white d-flex justify-content-between align-items-center py-3">
8
<p class="h5-responsive font-weight-bold mb-0"><i class="fas fa-inbox pr-2"></i>Sales</p>
9
<p class="h5-responsive font-weight-bold mb-0"><a><i class="fas fa-times"></i></a></p>
10
</div>
11
<div class="card-body">
12
<canvas id="lineChart"></canvas>
13
</div>
14
</div>
15
16
</section>
17
<!-- Section: Block Content -->
18
19
</div>
CSS
1
1
JS
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", "August"],
7
datasets: [
8
{
9
label: "My Second dataset",
10
data: [28, 38, 55, 45, 55, 80, 65, 54],
11
backgroundColor: [
12
'rgb(206, 224, 229)',
13
],
14
borderColor: [
15
'rgb(124, 154, 163)',
16
],
17
borderWidth: 2
18
},
19
{
20
label: "My First dataset",
21
data: [38, 48, 60, 55, 65, 85, 75, 68],
22
backgroundColor: [
23
'rgb(30, 134, 219)',
24
],
25
borderColor: [
26
'rgb(29, 84, 147)',
27
],
28
borderWidth: 2
29
}
30
]
31
},
32
options: {
33
legend: {
34
display: false
35
},
36
scales: {
37
xAxes: [{
38
gridLines: {
39
color: "transparent",
40
zeroLineColor: "transparent"
41
},
42
}],
43
yAxes: [{
44
display: true,
45
gridLines: {
46
display: true,
47
},
48
}],
49
}
50
}
51
});
Console errors: 0