<script>
// Get the canvas element
var ctx = document.getElementById('myChart').getContext('2d');
// Define the chart data
var data = {
labels: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
datasets: [{
label: 'day records',
data: [12, 19, 3, 5, 2, 3],
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(255, 159, 64, 0.2)',
'rgba(255, 205, 86, 0.2)',
'rgba(75, 192, 192, 0.2)',
'rgba(54, 162, 235, 0.2)',
'rgba(153, 102, 255, 0.2)',
'rgba(201, 203, 207, 0.2)'
],
borderColor: 'rgba(54, 162, 235, 1)', // Set the border color
borderWidth: 1 // Set the border width
}]
};
// Configure the chart options
var options = {
responsive: true,
maintainAspectRatio: false,
scales: {
y: {
beginAtZero: true
}
}
};
// Create the chart
var myChart = new Chart(ctx, {
type: 'bar',
data: data,
options: options
});
</script>
0 Comments (Please let us know your query)