[Chartjs]-ChartJS: Remove padding to the right of chart caused by tick labels

12👍

You should be able to resolve some things like that by using the different callback hooks that are available in the update process.

Testing things out on my own, I was able get it to fix that gap by setting the right padding on the axis to 0 in the afterFit method, which based on the docs is:

Callback that runs after the scale fits to the canvas

const options = {
  scales: {
    xAxes: [{
      afterFit: (axis) => {
        axis.paddingRight = 0;
      }
    }]
  }
}

Leave a comment