score:2

Accepted answer

try with this code inside the option section

 scales: {
      yaxes: [{
        ticks: {
          beginatzero: true,
          callback: function(value) {if (value % 1 === 0) {return value;}}
        }
      }]
    }

score:5

a better way to do it which allows for scaling is to use the precision property:

scales: {
    y: {
        ticks: {
            precision: 0
        }
    }
}

this way, if you add a 100 or something, it can increase the step size if needed. it just won't even lower it below 1.

score:9

you can use the stepsize property:

scales: {
  yaxes: [{
    ticks: {
      stepsize: 1
    }
  }]
}

Related Query