File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,20 @@ public function setData(array $data): self
49
49
}
50
50
51
51
/**
52
+ * Sets Chart.js options.
53
+ *
54
+ * @see https://www.chartjs.org/docs/latest/
55
+ *
56
+ * <code>
57
+ * $chart->setOptions([
58
+ * 'scales' => [
59
+ * 'yAxes' => [
60
+ * ['ticks' => ['min' => 0, 'max' => 100]],
61
+ * ]
62
+ * ]
63
+ * ]);
64
+ * </code>
65
+ *
52
66
* @return $this
53
67
*/
54
68
public function setOptions (array $ options ): self
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