HTML
xxxxxxxxxx
1
<div class="container my-5 py">
2
3
4
<!--Section: Block Content-->
5
<section>
6
7
<div class="card indigo">
8
<div class="card-body">
9
10
<p class="h5 white-text pb-4 mb-3"><i class="fas fa-chart-pie px-2"></i>Sales Chart</p>
11
12
<canvas id="lineChart1" class="mb-4" height="100"></canvas>
13
14
</div>
15
16
<div class="card-body white">
17
18
<!--Grid row-->
19
<div class="row text-center text-muted my-2">
20
21
<!--Grid column-->
22
<div class="col-md-4 mb-4 mb-md-0">
23
24
<span class="min-chart mt-0 mb-3" id="chart-pageviews" data-percent="86">
25
<span class="percent"></span>
26
</span>
27
<p class="small mb-md-0">Mail-Orders</p>
28
29
</div>
30
<!--Grid column-->
31
32
<!--Grid column-->
33
<div class="col-md-4 mb-4 mb-md-0">
34
35
<span class="min-chart mt-0 mb-3" id="chart-sales" data-percent="54">
36
<span class="percent"></span>
37
</span>
38
<p class="small mb-md-0">Online</p>
39
40
</div>
41
<!--Grid column-->
42
43
<!--Grid column-->
44
<div class="col-md-4 mb-0">
45
46
<span class="min-chart mt-0 mb-3" id="chart-downloads" data-percent="72">
47
<span class="percent"></span>
48
</span>
49
<p class="small mb-0">In-Store</p>
50
51
</div>
52
<!--Grid column-->
53
54
</div>
55
<!--Grid row-->
56
57
</div>
58
</div>
59
60
61
</section>
62
<!--Section: Block Content-->
63
64
65
</div>
CSS
1
1
JS
xxxxxxxxxx
1
//line
2
var ctxL = document.getElementById("lineChart1").getContext('2d');
3
var myLineChart = new Chart(ctxL, {
4
type: 'line',
5
data: {
6
labels: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October"],
7
datasets: [{
8
pointBackgroundColor: '#fff',
9
backgroundColor: 'transparent',
10
borderColor: 'rgba(255, 255, 255)',
11
data: [2500, 2550, 5000, 3100, 7000, 5500, 4950, 16000, 10500, 8000],
12
}]
13
},
14
options: {
15
legend: {
16
display: false
17
},
18
scales: {
19
xAxes: [{
20
gridLines: {
21
display: false,
22
color: "transparent",
23
zeroLineColor: "transparent"
24
},
25
ticks: {
26
fontColor: "#fff",
27
},
28
}],
29
yAxes: [{
30
display: true,
31
gridLines: {
32
display: true,
33
drawBorder: false,
34
color: "rgba(255,255,255,.25)",
35
zeroLineColor: "rgba(255,255,255,.25)"
36
},
37
ticks: {
38
fontColor: "#fff",
39
beginAtZero: true,
40
stepSize: 5000
41
},
42
}],
43
}
44
}
45
});
46
47
// Minimalist charts
48
$(function () {
49
$('.min-chart#chart-pageviews').easyPieChart({
50
barColor: "#3059B0",
51
onStep: function (from, to, percent) {
52
$(this.el).find('.percent').text(Math.round(percent));
53
}
54
});
55
$('.min-chart#chart-downloads').easyPieChart({
56
barColor: "#3059B0",
57
onStep: function (from, to, percent) {
58
$(this.el).find('.percent').text(Math.round(percent));
59
}
60
});
61
$('.min-chart#chart-sales').easyPieChart({
62
barColor: "#3059B0",
63
onStep: function (from, to, percent) {
64
$(this.el).find('.percent').text(Math.round(percent));
65
}
66
});
67
});
Console errors: 0