[Chartjs]-Chart.js: Minimum value for x-axis at horizontal stacked bar chart

1๐Ÿ‘

I was able to get a suitable result using a callback like this:

xAxes: [{
    ticks: {
        min: 0,
        callback: function (value, index, values) {
            return value + 2017;
        }
     },
...
]

0๐Ÿ‘

I found that suggestedMin works well:

options: {
  scales: {
      xAxes: [{
          display: true,
          ticks: {
              suggestedMin: 2017
          }
      }]
  }
}

Leave a comment