Chartjs-How I can add some horizontal padding to x-axis tick values in Chart.js?

0👍

You can define offset: true on the x-axis as follows:

options: {
  scales: {
    xAxes: [{
      offset: true
    }]
  }
}

offset: If true, extra space is added to the both edges and the axis is scaled to fit into the chart area. This is set to true for a bar chart by default.

Leave a comment