Chartjs-How to manage Y-axis on Chart.js?

0👍

If you open up your browser’s dev tools, in the console it’s likely you would see this error:

Invalid scale configuration for scale: yAxes

At least that’s what I see when trying to use your options object. This tells us that we’ve not written the scales property correctly. Looking at the chart.js documentation, we see that scales is always an object, not an array of objects. Also based on your requirements it sounds like you would want to set max instead of maxTicksLimit which means you should write an options object like this:

options: {
  scales: {
    yAxes: {
      display: true,
      max: 45,
      ticks: {
        stepSize: 15
      }
    }
  }
}

Leave a comment