[Chartjs]-Chart.js control space between/size of gridlines

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

Leave a comment