2๐
โ
Try with this code inside the option
section
scales: {
yAxes: [{
ticks: {
beginAtZero: true,
callback: function(value) {if (value % 1 === 0) {return value;}}
}
}]
}
10๐
You can use the stepSize
property:
scales: {
yAxes: [{
ticks: {
stepSize: 1
}
}]
}
8๐
A better way to do it which allows for scaling is to use the precision
property:
scales: {
y: {
ticks: {
precision: 0
}
}
}
This way, if you add a 100 or something, it can increase the step size if needed. It just wonโt even lower it below 1.
Source:stackexchange.com