Chartjs-Chart js axes padding

0👍

You can define y.ticks.padding as follows:

y: {
  ticks: {
    ... 
    padding: -50
  }
}

Together with this, you also need to define layout.padding.left to make sure, the tick labels still appear on the canvas.

options: {
  layout: {
    padding: {
      left: 100
    }
  }
  ...

Obviously you need to adapt the numbers to your needs.

For further information, please consult Tick Configuration and Padding from the Chart.js documentation.

Leave a comment