[Chartjs]-Space between ticks marks and X axis with chart.js

2๐Ÿ‘

โœ…

So I have found a solution, for anyone interested in how :

By checking this chart.js doc, you can find an option called offset which will create as explained an extra space.

Then to get the exact result I wanted, you hide the X axis.

Which gives us this :

x: {
    grid: {
        drawBorder: false, // hide the x axis
    },
},
y: {
    offset: true, // create a sensation of space with the x axis hidden
},

Leave a comment