Chartjs-How to create a fixed number of y axes for a chartsjs linear graph?

0👍

If we want to limit the minimum and maximum value for the y-axis then we can add the scales property to the options and set the yAxes property.

In the following example we are setting the minimum value for the y-axis to -10 and maximum value to 80 and we are also defining the stepSize of 10.

var options = {
    scales: {
        yAxes: [{
            ticks: {
                max: 80,
                min: -10,
                stepSize: 10
            }
        }]
    },
};

Leave a comment