kshitizmittal
5 months ago
230
3
Laravel

Chart Js change axes type

Posted 5 months ago by kshitizmittal

I need to change the y-axis as time in format of hh:mm:ss Below is the controller code in which $avg_efficiency_data->values() is in time format.

$efficiencyChart = new SampleChart;
        $efficiencyChart->labels($avg_efficiency_data->keys());
        $efficiencyChart->dataset('Efficiency Avg', 'line', $avg_efficiency_data->values())->options(['backgroundColor' => '#A569BD', 'fill' => false, 'borderColor' => '#A569BD']);

Package used is :- https://charts.erik.cat/supported_libraries.html#chartjs-2-7-1

Please help.

Please sign in or create an account to participate in this conversation.