When using the following code to generate a chart, I am not able to set the scale to begin at zero, even setting that option.
Here is the code (JSFiddle)
var simpleChart = new Chart(document.getElementById('chart'), {
type: 'bar',
data: {
labels: ['Online', 'Offline'],
datasets: [{
label: "# of servers",
data: [1, 7],
backgroundColor: [
'#009245',
'#c02a31'
]
}]
},
options: {
title: {
display: false
},
scales: {
yAxes: [{
beginAtZero: true
}]
}
}
});
Is this a bug? What should I do to be able to set the scale to really start at 0?
Also, how can I disable that "# of servers"
label from being rendered?