LoadEvents with description

This commit is contained in:
salam committed 2026-05-23 14:38:44 +02:00
1 parent 4f63a4ef2c
commit 1f4fb9cf8a
6 files changed
+48 -144

No files matched your search

@@ -5,7 +5,6 @@ namespace App\Filament\Widgets;
use App\Filament\Widgets\Data\HelperMoveingAverage;
use App\Filament\Widgets\Data\HelperStatisticType;
use App\Filament\Widgets\Data\LoadEvents;
use Filament\Support\RawJs;
use Filament\Widgets\ChartWidget;
use Filament\Widgets\Concerns\InteractsWithPageFilters;
@@ -15,8 +14,6 @@ class ChartMovingAverageEvent extends ChartWidget
protected ?string $pollingInterval = null;
public ?string $header;
protected ?array $options = [
'plugins' => [
'legend' => [
@@ -28,19 +25,16 @@ class ChartMovingAverageEvent extends ChartWidget
],
];
public function getDescription(): ?string
{
return 'Events Moving Average';
}
protected function getData(): array
{
$this->heading = HelperStatisticType::get($this->filters);
$this->heading = 'Events '.HelperStatisticType::get($this->filters);
$data = LoadEvents::load($this->filters);
if ($data) {
HelperMoveingAverage::get($data);
$this->description = 'Moving Average '.$data['description'];
}
return $data;
@@ -50,32 +44,4 @@ class ChartMovingAverageEvent extends ChartWidget
{
return 'line';
}
// protected function getOptions(): array|RawJs|null
// {
// return [
// 'plugins' => [
// 'legend' => [
// 'display' => display,
// ],
// 'tooltip' => [
// 'callbacks' => [
// 'label' => RawJs::make(<<<'JS'
// function(context) {
// let label = context.dataset.label || '';
// if (label) {
// label += ': ';
// }
// return label;
// }
// JS),
// ],
// ],
// ],
// 'interaction' => [
// 'intersect' => false,
// ],
// ];
// }
}