score:18

Accepted answer

also include scalestartvalue and scalestepwidth as stated in docs.

example

this example creates a bar chart with y-axis starting at 0 and ending at 900. to do that, step width is set to 100 and number of steps are set to 9.

html

<!doctype html>
<html lang="en">
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/chart.js/1.0.2/chart.min.js"></script>
  <meta charset="utf-8">
  <title>js bin</title>
</head>
    <body>
      <canvas id="income" width="600" height="400"></canvas>
    </body>
</html>

js

var bardata = {
    labels : ["january","february","march","april","may","june"],
    datasets : [
        {
            fillcolor : "#48a497",
            strokecolor : "#48a4d1",
            data : [456,479,324,569,702,600]
        },
        {
            fillcolor : "rgba(73,188,170,0.4)",
            strokecolor : "rgba(72,174,209,0.4)",
            data : [364,504,605,400,345,320]
        }

    ]
};

var income = document.getelementbyid("income").getcontext("2d");

new chart(income).bar(bardata, {
  animation:false,
  scaleoverride:true,
  scalesteps:9,
  scalestartvalue:0,
  scalestepwidth:100
});

score:0

for those who struggle with react-chartjs-2:

example that starts from 0, makes 2 steps each of size 20 and goes up to max

let options = {
  scales: {
    y: {
      ticks: {
        beginatzero: true,
        steps: 2,
        stepsize: 20,
        max: 40
      }
    }
  }
}

usage:

// ... your component structure
return <line options={options} />

score:1

@2.8.0 custom y-axis setup. you only need range min/max and with stepsize you control the axis.

...
yaxes: [{
        ticks: {
            stepsize: 0.1,
            min: 2,
            max: 2.5
            },
        gridlines: {
            display: false 
            },
        stacked: false
                    }]
 ...

score:12

var mychart = new chart(ctx, {
                type: 'bar',
                data:data,
                options: {
                    responsive: true,
                    scales: {
                        yaxes: [{
                            ticks: {
                                beginatzero: true,
                                steps: 10,
                                stepvalue: 6,
                                max: 60 //max value for the chart is 60
                                }
                            }
                        }]
                    }
                }
            });

Related Query

More Query from same tag