Files
nuhodds_fi4/app/Filament/Widgets/PunctualChart.php
T
2026-04-29 19:00:46 +02:00

46 lines
1.0 KiB
PHP

<?php
namespace App\Filament\Widgets;
// use App\Actions\Statistics\StatisticEvents;
use App\Actions\Statistics\StatisticType;
use Filament\Widgets\ChartWidget;
use Filament\Widgets\Concerns\InteractsWithPageFilters;
class PunctualChart extends ChartWidget
{
use InteractsWithPageFilters;
protected ?string $pollingInterval = null;
public ?string $header;
public function getDescription(): ?string
{
return 'Punctual';
}
protected function getData(): array
{
$this->heading = StatisticType::get($this->filters);
$data = [
'datasets' => [
[
'label' => 'test',
'data' => [0, 10, 5, 2, 21, 32, 45, 74, 65, 45, 77, 89],
'backgroundColor' => '#36A2EB',
],
],
'labels' => ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
];
return $data;
}
protected function getType(): string
{
return 'line';
}
}