mercredi 28 août 2019

how to array inside the array in laravel chart

i have issue of having data from database, i want to get the array of my sales in group by month and group by product with array of sales sum of per month please help me.

i tried to get it using query builder and eloquent but i cant do it .

                    ->title('Sales Chart for CF')
                    ->colors(['#ff0000', '#ff','#56f442','#41caf4'])
                    ->labels($month_array)
                    ->dataset('product1',[])
                    ->dataset('product1',[5212,383,153])
                    ->dataset('product1',[1212,383,113])
                    ->dataset('product1',[1212,383,113]);

my desire output is

->dataset('array of proudct','array of sales monthly')



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire