[Chartjs]-How to set start value as โ€œ0โ€ in Chart.js Laravel

1๐Ÿ‘

โœ…

Youโ€™ll have to set the beginAtZero option:

$chartOptions = [
    'scales' => [
        'yAxes' => [
            [
                'ticks' => [
                    'beginAtZero' => true,
                ],
            ],
        ],
    ],
];

->options($chartOptions);

0๐Ÿ‘

If you want the y-axis to start at zero you can include it in the options

options: {
    scales: {
        yAxes: [{
            ticks: {
                beginAtZero: true
            }
        }]
    }
}

Leave a comment