7👍
You can set a maximum number of vertical grid lines (for x axis) :
scales: {
xAxes: [{
ticks: {
maxTicksLimit: 20,
},
}]
},
0👍
Might not be the best solution but by setting a fix hight or width you can control the max-space between the gridLines
<canvas id="myChart" width="1200px"></canvas>
0👍
I’ve spent a few days trying to solve this exact problem. This video led me to the ultimate solution to this: https://www.youtube.com/watch?v=XUAP3szj_u8
- [Chartjs]-Change the Y-axis values from real numbers to integers in Chart.js
- [Chartjs]-Chart.JS: How to add Data to a specific dataset
Source:stackexchange.com