LaravelDaily / laravel-charts

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

Conditions not work #92

Open amruh opened 2 years ago

amruh commented 2 years ago

I watch your video about Chart with Multiple Datasets, which we should add conditions keys to display multiple datasets, but it seems not working properly in my case, it only display one line in chart

$charts = [ 'chart_title' => 'Visitors by dates', 'chart_type' => 'line', 'report_type' => 'group_by_date', 'model' => 'App\Models\Visitors', 'conditions' => [ ['name' => 'item_1', 'condition' => 'table_id = 1', 'color' => 'blue', 'fill' => true], ['name' => 'item_1', 'condition' => 'table_id = 6', 'color' => 'red', 'fill' => true], ], 'group_by_field' => 'created_at', 'group_by_period' => 'day', 'aggregate_function' => 'sum', 'aggregate_field' => 'amount', 'filter_field' => 'created_at', 'filter_days' => 30, 'filter_period' => 'week', 'continuous_time' => true, ];

krekas commented 2 years ago

@amruh can you set up demo project to reproduce problem?

amruh commented 2 years ago

image i think by adding two condition will show up two lines ? or i missed something ?

PovilasKorop commented 1 year ago

@amruh sorry to be quiet on this, our team is busy with other projects. We reproduced the bug and confirm it but were unable to find a quick fix, without breaking other features. Will still try to find time to work on this, some time later.