// /app/Livewire/CustomPage.phppublic function getHeaderWidgets(): array{ return [ ExampleOverview::make([ 'foo' => $this->foo ?? [], ]) ];}public function refresh(): void { $this->foo[] = 0 // New data chart $this->dispatch('update-foo');}
//app/Livewire/ExampleOverview.phpclass ExampleOverview extends BaseWidget{ public array $foo = []; #[On('update-foo')] protected function getStats(): array { return [ Stat::make('','') ->chart($this->foo) ]; }}