sibanu_web/public/assets/js/components/charts/chart-bars.js
2022-08-20 13:21:23 +07:00

44 lines
547 B
JavaScript

//
// Bars chart
//
var BarsChart = (function() {
//
// Variables
//
var $chart = $('#chart-bars');
//
// Methods
//
// Init chart
function initChart($chart) {
// Create chart
var ordersChart = new Chart($chart, {
type: 'bar',
data: {
labels: ['Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
datasets: [{
label: 'Sales',
data: [25, 20, 30, 22, 17, 29]
}]
}
});
// Save to jQuery object
$chart.data('chart', ordersChart);
}
// Init chart
if ($chart.length) {
initChart($chart);
}
})();