LaravelDaily / laravel-charts

Package to draw charts in Laravel with Chart.js
MIT License
522 stars 116 forks source link

Sorting issue #95

Open malogajski opened 1 year ago

malogajski commented 1 year ago

Result isn’t sorted properly (year, month ASC) and I'm not sure why?

configuration:

'chart_title'           => 'Monthly income',
'chart_type'            => 'bar',
'report_type'           => 'group_by_date',
'model'                 => 'App\Models\Invoice',
'group_by_field'        => 'invoice_date',
'group_by_period'       => 'month',
'aggregate_function'    => 'sum',
'aggregate_field'       => 'total',
'filter_field'          => 'invoice_date',
'filter_period'         => 'year',
'group_by_field_format' => 'd.m.Y',
'column_class'          => 'w-full',
'entries_number'        => '5',
'translation_key'       => 'invoice',

Result - check months

image

PovilasKorop commented 1 year ago

@malogajski hard to say without debugging with your real data or reproducing. Is your project open-source by any chance and I could reproduce the situation?

The parameters seem all correct, I don't see any obvious issues.