Tuesday 15 July 2014

php - How to make Laravel charts using ajax and morris.js? -



php - How to make Laravel charts using ajax and morris.js? -

i want create graphs in laravel andi have done somethings in it.

i followed tutorial maxoffsky.com

now had followed tutorial , done on here: converting eloquent query josn. didnt understood how query,

$range = carboncarbon::now()->subdays(30); $stats = db::table('sales_flat_order_items w') ->leftjoin('sales_flat_orders s', 's.entity_id','=','w.order_id')= ->where('qty_canceled','=','0') ->where('s.created_at','>=',$range) ->groupby('s.created_at') ->orderby('s.created_at') ->get([db::raw('date(s.created_at) days'),db::raw('sum(w.qty_ordered) qty_ordered']); homecoming view::make('sales_flat_orders.orderbydate', compact('stats'));

i know to convert $stats json , display list of qty_ordered , date in view.

i have view named orderbydate, m displaying tables , js show bar chart.

i not able understand exact flow create dynamic graph. ie. values taken database

i think first need convert eloquent query array or json, understood if using single model,

magic method _tostring()

would have converted query json , popluate info on bar chart or pie chart or other.

php laravel laravel-4 morris.js

No comments:

Post a Comment