Skip to content

Commit

Permalink
improve docs
Browse files Browse the repository at this point in the history
  • Loading branch information
juliangums committed Jun 26, 2024
1 parent 10eb7f3 commit 6852379
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/widgets/docs/03-charts.md
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,18 @@ You can find out more about [asset registration](../support/assets), and even [r
## Empty state

The chart's "empty state" is rendered when there are is no data to display.
By default, the chart will not display this by itself. You have to figure out when to display it and simply call `$this->empty()` from another method of a Chart Widget.
Usually, you would call this method from the `getData()` method, when there is no data to display.

```php
protected function getData(): array
{
...
if ($noData) {
$this->empty();
}
}
```

## Setting the empty state heading

Expand Down

0 comments on commit 6852379

Please sign in to comment.