2๐
โ
15 is the smallest number in your dataset. Depending on how Chart.js determines the linear y-axis scale, it might start at 15. This means no bar is drawn as the value is equal to the lowest point of the y-axis, i.e.:
You can fix the issue by adding the beginAtZero
property to your chart options
:
options: {
title: {
display: true,
text: 'Title Text'
},
scales: {
yAxes: [{
ticks: {
beginAtZero: true
}
}]
}
}
Result:
Source:stackexchange.com