3👍
This is because, ChartJS automatically calculates y-axis ticks, which sometimes make the y-axis look incorrect, specially when the maximum tick‘s value is less than or equal to 5
.
One easiest way to solve this, is to set the stepSize
property to 1
for y-axis ticks, as such :
scales: {
yAxes: [{
ticks: {
stepSize: 1
}
}]
}
- Chartjs-I'm having problems registering the `category` scale in react-chart-js2
- Chartjs-How i can refresh chart without refresh page?
Source:stackexchange.com