File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,21 @@ public function setData(array $data)
43
43
$ this ->data = $ data ;
44
44
}
45
45
46
+ /**
47
+ * Sets Chart.js options.
48
+ *
49
+ * @see https://www.chartjs.org/docs/latest/
50
+ *
51
+ * <code>
52
+ * $chart->setOptions([
53
+ * 'scales' => [
54
+ * 'yAxes' => [
55
+ * ['ticks' => ['min' => 0, 'max' => 100]],
56
+ * ]
57
+ * ]
58
+ * ]);
59
+ * </code>
60
+ */
46
61
public function setOptions (array $ options )
47
62
{
48
63
$ this ->options = $ options ;
Original file line number Diff line number Diff line change @@ -47,7 +47,13 @@ class HomeController extends AbstractController
47
47
],
48
48
]);
49
49
50
- $chart->setOptions([/* ... */]);
50
+ $chart->setOptions([
51
+ 'scales' => [
52
+ 'yAxes' => [
53
+ ['ticks' => ['min' => 0, 'max' => 100]],
54
+ ],
55
+ ],
56
+ ]);
51
57
52
58
return $this->render('home/index.html.twig', [
53
59
'chart' => $chart,
You can’t perform that action at this time.
0 commit comments