i was trying to implement Chart with Laravel there i want to show my monthly collection which daily collection for that i used following Query
$data = Transaction::select('transactions.updated_at',
DB::raw('sum(collected_today) as aggregate'))->groupBy(DB::raw('Date(transactions.updated_at)'))->get();
$chart = Charts::database($data,'area', 'highcharts')
->preaggregated(true)
->title('Monthly Collection')
->elementLabel("Total")
->groupByDay();
but in chart it shows nothing means blank space. in the documentation it says To work with the GroupByYear, GroupByMonth, GroupByDay, lastByYear, lastByMonth & lastByDay you'll need the column created_at in the data rows.
But i need to use the updated_at means yesterday dues can be collected today which will be consider as today's collection. How can i make it working with updated_at. Thanks
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire