Chartjs-ChartJS linechart edit yAxis labels

1👍

This worked for me:

options: {
    maintainAspectRatio: false,
    responsive: true,
     scales: {
        yAxes: [{
            ticks: {
                beginAtZero:true
            }
        }]
    }
}

Note: I left the rest of the chart config as is. You did not explicitly supply the chartLabels and chartData variables, so I used:

var chartLabels = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
var chartData = [0, 0, 0, 0, 0, 0, 0];

Fiddle: https://jsfiddle.net/3c4yq5oq/

Leave a comment