Continued working on category controller [skip ci]

This commit is contained in:
James Cole
2014-07-30 14:45:46 +02:00
parent 04a9ada682
commit 00a767cfc9
22 changed files with 619 additions and 36 deletions

View File

@@ -110,5 +110,21 @@ class ChartController extends BaseController
return Response::json($this->_chart->categories($start, $end));
}
public function categoryShowChart(Category $category) {
$start = Session::get('start');
$end = Session::get('end');
$range = Session::get('range');
$serie = $this->_chart->categoryShowChart($category, $range, $start, $end);
$data = [
'chart_title' => $category->name,
'subtitle' => '<a href="' . route('categories.show', [$category->id]) . '">View more</a>',
'series' => $serie
];
return Response::json($data);
}
}