Chart.js Bar graph will not start at zero as minimum value

Move the options part to the Chart creation:

var LineGraph = new Chart(ctx, {
    type: 'line',
    data: chartdata,
    options: {
        responsive: true,
        scales: {
            yAxes: [{
                ticks: {
                    beginAtZero: true
                }
            }]
        }
    }
});

Here’s an example from the docs.

Leave a Comment