Hiding particular axes labels on bar chart

Is there a way to set the max/min of a chart but not have that value appear as a tick on the axes? (in the image I want it to not display the first and last numbers but to plot the graph up to them. Thanks for your help in advance

Hi @Georgia,

This is a little tricky - Chart.js automatically adds the min and max, so the easiest way to do this is to hide the first and last tick marks using ticks.callback.

For example:

          ticks: {
            min: -42.25,
            max: 35.25,
            callback: (value, index, values) =>
              index === values.length - 1 || index === 0 ? undefined : value,

Here’s an example in the chart editor

1 Like