Accepted answer

if you don't want to show point value (e.g. 0.5) labels you could write a callback function to filter the point value labels instead of using stepsize.

like this:

ticks: {
    min: 0, // it is for ignoring negative step.
    beginatzero: true,
    callback: function(value, index, values) {
        if (math.floor(value) === value) {
            return value;

working fiddle here:


as noted by atta h. and lekoaf below, chart.js added the precision property to ticks. it is available since version 2.7.3. see lekoaf's answer how to use this.


ticks: {
    precision: 0

this worked equally well as the callback function above and is much cleaner.

precision, if defined and stepsize is not specified, the step size will be rounded to this many decimal places.

Related Query

More Query from same tag