Chartjs-Chart.js v3: how to allow tick label overflow?

1๐Ÿ‘

You could format the first tick to be empty string, using ticks.callback

{
  type: 'time',
  ticks: {
    callback: (value, index) => index === 0 ? '' : value
  }
}

example in codepen

enter image description here

0๐Ÿ‘

I was eventually able to get the desired behavior using the afterFit callback.

{
  type: 'time',
  afterFit: (scaleInstance) => {
    scaleInstance.paddingLeft = 0;
    scaleInstance.paddingRight = 0;
  }
}

Leave a comment