Guest User

Untitled

a guest
Dec 17th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. Product1 200 visits
  2. product5 30 visits
  3. product10 47visits
  4.  
  5. $chartjson = Pagevisit::all()->toJson();
  6. $chartjsontitle =
  7. DB::table('products')
  8. ->join('page-visits', function ($join) {
  9. $join->on('products.id', '=', 'page-visits.visitable_id');
  10. })->get();
  11. $value = collect($chartjsontitle)->toArray();
  12.  
  13. $chart4 = Charts::database($chartjson, 'bar', 'highcharts')
  14. ->elementLabel("Total")
  15. ->dimensions(1000, 500)
  16. ->responsive(false)
  17. ->values('visitable_id')
  18. ->labels($value);
Add Comment
Please, Sign In to add comment