sibanu_web/public/assets/js/components/charts/chart-bars.js

44 lines
547 B
JavaScript
Raw Normal View History

2022-08-20 13:21:23 +07:00
//
// 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);
}
})();