score:0

by default, chart.js automatically calculates how many labels can be shown and hides labels accordingly. this is controlled by ticks.autoskip that has default value true.

if you explicitly define yaxes.ticks.stepsize however, autoskip is ignored and a tick is shown for all matching steps.

solution 1

the easiest solution is to remove yaxis.ticks from the options and let autoskip manage tick generation.

solution 2

you may also increase stepsize and choose whatever suits you.

yaxes: [{
  ticks: {
    stepsize: 10
  }
}]

solution 3

another option would be to define the exact number of ticks to be show using yaxes.ticks.maxtickslimit.

yaxes: [{
  ticks: {
    maxtickslimit: 5
  }
}]

Related Query

More Query from same tag