Files
nuhodds_fi4/app/Filament/Widgets/ChartEventPerf.php
T
2026-05-30 18:48:15 +02:00

52 lines
1.1 KiB
PHP

<?php
namespace App\Filament\Widgets;
use App\Filament\Widgets\Data\LoadPerformance;
use Filament\Support\RawJs;
use Filament\Widgets\ChartWidget;
use Livewire\Attributes\Reactive;
class ChartEventPerf extends ChartWidget
{
#[Reactive]
public ?array $filters = [];
protected ?string $heading = 'Events';
protected ?string $description = 'Performance';
protected ?string $pollingInterval = null;
protected bool $isCollapsible = true;
protected function getData(): array
{
return LoadPerformance::load($this->filters);
}
protected function getType(): string
{
return 'line';
}
protected function getOptions(): RawJs
{
return RawJs::make(<<<'JS'
{
interaction: {
intersect: false,
},
scales: {
x: {
title: {
display: true,
text: 'Days since today'
}
},
},
}
JS);
}
}