score:1

Accepted answer

the reason of this not working is merely related to the chartjs version you are using. since you are using chartjs version 1.x, the current scales option will not be applicable for the chart.

you should rather use the following scale options ...

scaleoverride: true,
scalesteps: 10,
scalestepwidth: 10,

ᴡᴏʀᴋɪɴɢ ᴇxᴀᴍᴘʟᴇ

var ctx = document.getelementbyid("canvas").getcontext("2d");
var data = {
   labels: ['jan', 'feb', 'mar'],
   datasets: [{
      label: "# of votes",
      fillcolor: "#07c",
      data: [50, 80, 200]
   }]
};

var mybarchart = new chart(ctx).bar(data, {
   scaleoverride: true,
   scalesteps: 10, // number of ticks
   scalestepwidth: 10, // tick interval
   scalebeginatzero: true
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/chart.js/1.0.2/chart.min.js"></script>
<canvas id="canvas" width="350" height="200"></canvas>

score:0

for chart.js v3.x.x, use the below (tested using v3.3.2):

var options = {
    scales: {
        y: {
            suggestedmin: 0,
            suggestedmax: 100
        },
        x: {
            suggestedmin: 0,
            suggestedmax: 100
        }
    }
}

read: https://www.chartjs.org/docs/3.3.2/axes/#axis-range-settings


Related Query

More Query from same tag