<div class="line-chart"></div>
Copy HTML
/*
* File: line-chart-v1.js
* Location /src/js/components
* Line chart v1 component
*/
(function() {
new Chart({
element: '.line-chart',
type: 'line',
legend: true,
lineIndicator: true,
chartOptions: {
smooth: false,
line: {
showAnchorPoints: true
}
},
datapoints: [{
name: 'Kodhus',
data: [1, 25, 3, 90, 30, 90, 160, 0, 21, 3, 18, 2]
}],
xAxis: {
title: 'Month',
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
labelModifier: function(value) {
return 'Month ' + value;
}
},
yAxis: {
title: 'Total'
},
tooltip: {
enabled: true
}
});
})();
Copy JS