From 0e35baca70f3e034508dd83b6a5a32249029b3b7 Mon Sep 17 00:00:00 2001 From: salam Date: Wed, 27 May 2026 12:28:23 +0200 Subject: [PATCH] wip --- .../Widgets/ChartMovingAverageEvent.php | 18 +++++++++--------- .../Widgets/ChartMovingAveragePlayer.php | 4 +++- app/Filament/Widgets/ChartPunctualEvent.php | 6 ++++-- app/Filament/Widgets/ChartPunctualPlayer.php | 10 +++++++--- 4 files changed, 23 insertions(+), 15 deletions(-) diff --git a/app/Filament/Widgets/ChartMovingAverageEvent.php b/app/Filament/Widgets/ChartMovingAverageEvent.php index 8d8c885c..82c40133 100644 --- a/app/Filament/Widgets/ChartMovingAverageEvent.php +++ b/app/Filament/Widgets/ChartMovingAverageEvent.php @@ -17,24 +17,24 @@ class ChartMovingAverageEvent extends ChartWidget protected function getData(): array { - $this->heading = 'Events '.HelperStatisticType::get($this->filters); + $this->heading = 'Events'; $data = LoadEvents::load($this->filters); - if ($data) { - HelperMoveingAverage::get($data); + $this->description = HelperStatisticType::get($this->filters).' Moving Average'; - $this->description = 'Moving Average '.$data['description']; + if ($data) { + + if (isset($data['description'])) { + $this->description .= $data['description']; + } + + HelperMoveingAverage::get($data); } return $data; } - public function getDescription(): ?string - { - return 'Moving Average'; - } - protected function getType(): string { return 'line'; diff --git a/app/Filament/Widgets/ChartMovingAveragePlayer.php b/app/Filament/Widgets/ChartMovingAveragePlayer.php index 157fb598..4c93bbbe 100644 --- a/app/Filament/Widgets/ChartMovingAveragePlayer.php +++ b/app/Filament/Widgets/ChartMovingAveragePlayer.php @@ -43,7 +43,9 @@ class ChartMovingAveragePlayer extends ChartWidget return []; } - $this->heading = 'Player '.HelperStatisticType::get($this->filters); + $this->heading = 'Player'; + + $this->description = HelperStatisticType::get($this->filters); $data = LoadPlayer::load($this->filters); diff --git a/app/Filament/Widgets/ChartPunctualEvent.php b/app/Filament/Widgets/ChartPunctualEvent.php index f9d1f514..296a92a3 100644 --- a/app/Filament/Widgets/ChartPunctualEvent.php +++ b/app/Filament/Widgets/ChartPunctualEvent.php @@ -16,12 +16,14 @@ class ChartPunctualEvent extends ChartWidget protected function getData(): array { - $this->heading = 'Events '.HelperStatisticType::get($this->filters); + $this->heading = 'Events'; $data = LoadEvents::load($this->filters); + $this->description = HelperStatisticType::get($this->filters); + if (isset($data['description'])) { - $this->description = $data['description']; + $this->description .= $data['description']; } return $data; diff --git a/app/Filament/Widgets/ChartPunctualPlayer.php b/app/Filament/Widgets/ChartPunctualPlayer.php index 27a421a9..dfddd36e 100644 --- a/app/Filament/Widgets/ChartPunctualPlayer.php +++ b/app/Filament/Widgets/ChartPunctualPlayer.php @@ -13,8 +13,6 @@ class ChartPunctualPlayer extends ChartWidget protected ?string $pollingInterval = null; - public ?string $header; - protected ?array $options = [ 'plugins' => [ 'legend' => [ @@ -37,7 +35,13 @@ class ChartPunctualPlayer extends ChartWidget return []; } - $this->heading = 'Player '.HelperStatisticType::get($this->filters); + $this->heading = 'Player'; + + $this->description = HelperStatisticType::get($this->filters); + + if (isset($data['description'])) { + $this->description .= $data['description']; + } $data = LoadPlayer::load($this->filters);