43 lines
925 B
PHP
43 lines
925 B
PHP
<?php
|
|
|
|
namespace App\Filament\Widgets;
|
|
|
|
use App\Filament\Widgets\Data\HelperStatisticType;
|
|
use App\Filament\Widgets\Data\LoadEvents;
|
|
use Filament\Widgets\ChartWidget;
|
|
use Filament\Widgets\Concerns\InteractsWithPageFilters;
|
|
|
|
class ChartPunctualEvent extends ChartWidget
|
|
{
|
|
use InteractsWithPageFilters;
|
|
|
|
protected ?string $pollingInterval = null;
|
|
|
|
protected ?array $options = [
|
|
'plugins' => [
|
|
'legend' => [
|
|
'display' => false,
|
|
],
|
|
],
|
|
'interaction' => [
|
|
'intersect' => false,
|
|
],
|
|
];
|
|
|
|
protected function getData(): array
|
|
{
|
|
$this->heading = 'Events '.HelperStatisticType::get($this->filters);
|
|
|
|
$data = LoadEvents::load($this->filters);
|
|
|
|
$this->description = 'Punctual '.$data['description'];
|
|
|
|
return $data;
|
|
}
|
|
|
|
protected function getType(): string
|
|
{
|
|
return 'line';
|
|
}
|
|
}
|