34 lines
1.1 KiB
JavaScript
34 lines
1.1 KiB
JavaScript
document.addEventListener("DOMContentLoaded", function() {
|
|
const ctx = document.getElementById('orderChart');
|
|
if (ctx) {
|
|
new Chart(ctx, {
|
|
type: 'bar',
|
|
data: {
|
|
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun', 'Jul', 'Ags', 'Sep', 'Okt', 'Nov', 'Des'],
|
|
datasets: [{
|
|
label: 'Jumlah Order',
|
|
data: [12, 19, 3, 5, 2, 3, 7, 8, 10, 15, 9, 11],
|
|
backgroundColor: 'rgba(0, 80, 160, 0.7)',
|
|
borderColor: 'rgba(0, 80, 160, 1)',
|
|
borderWidth: 1,
|
|
borderRadius: 5
|
|
}]
|
|
},
|
|
options: {
|
|
responsive: true,
|
|
maintainAspectRatio: false,
|
|
scales: {
|
|
y: {
|
|
beginAtZero: true
|
|
}
|
|
},
|
|
plugins: {
|
|
legend: {
|
|
display: false
|
|
}
|
|
}
|
|
}
|
|
});
|
|
}
|
|
});
|