40 lines
809 B
PHP
40 lines
809 B
PHP
<?php
|
|
|
|
namespace App\Filament\Widgets;
|
|
|
|
use App\Actions\Statistics\LoadEvents;
|
|
use App\Actions\Statistics\MoveingAverage;
|
|
use App\Actions\Statistics\StatisticType;
|
|
use Filament\Widgets\ChartWidget;
|
|
use Filament\Widgets\Concerns\InteractsWithPageFilters;
|
|
|
|
class MovingAverageChart extends ChartWidget
|
|
{
|
|
use InteractsWithPageFilters;
|
|
|
|
protected ?string $pollingInterval = null;
|
|
|
|
public ?string $header;
|
|
|
|
public function getDescription(): ?string
|
|
{
|
|
return 'Moving Average';
|
|
}
|
|
|
|
protected function getData(): array
|
|
{
|
|
$this->heading = StatisticType::get($this->filters);
|
|
|
|
$data = LoadEvents::load($this->filters);
|
|
|
|
MoveingAverage::get($data);
|
|
|
|
return $data;
|
|
}
|
|
|
|
protected function getType(): string
|
|
{
|
|
return 'line';
|
|
}
|
|
}
|