Update 03-charts.md

This commit is contained in:
Dan Harrin
2025-05-27 15:27:42 +01:00
committed by GitHub
parent e0497e29a5
commit 60e30ed965
+8 -8
View File
@@ -182,14 +182,6 @@ You may place a maximum height on the chart to ensure that it doesn't get too bi
protected ?string $maxHeight = '300px';
```
## Making the chart collapsible
You may enable the chart to be collapsible by setting the `$isCollapsible` property:
```php
protected ?bool $isCollapsible = true;
```
## Setting chart configuration options
You may specify an `$options` variable on the chart class to control the many configuration options that the Chart.js library provides. For instance, you could turn off the [legend](https://www.chartjs.org/docs/latest/configuration/legend.html) for a line chart:
@@ -261,6 +253,14 @@ To disable this behavior, you may override the `$isLazy` property on the widget
protected static bool $isLazy = true;
```
## Making the chart collapsible
You may allow the chart to be collapsible by setting the `$isCollapsible` property on the widget class to be `true`:
```php
protected bool $isCollapsible = true;
```
## Using custom Chart.js plugins
Chart.js offers a powerful plugin system that allows you to extend its functionality and create custom chart behaviors. This guide details how to use them in a chart widget.