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

+3 -84
View File
@@ -4,7 +4,6 @@ namespace App\Filament\Widgets;
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;
@@ -14,8 +13,6 @@ class ChartPunctualEvent extends ChartWidget
protected ?string $pollingInterval = null;
public ?string $header;
protected ?array $options = [
'plugins' => [
'legend' => [
@@ -25,29 +22,16 @@ class ChartPunctualEvent extends ChartWidget
'interaction' => [
'intersect' => false,
],
// 'scales' => [
// 'xAxes' => [
// 'type' => 'time',
// 'time' => [
// 'tooltipFormat' => 'MM/DD/YYYY',
// 'displayFormats' => 'HH:mm:ss',
// ],
// ],
// ],
];
public function getDescription(): ?string
{
return 'Events Punctual';
}
protected function getData(): array
{
$this->heading = HelperStatisticType::get($this->filters);
$this->heading = 'Events '.HelperStatisticType::get($this->filters);
$data = LoadEvents::load($this->filters);
$this->description = 'Punctual '.$data['description'];
return $data;
}
@@ -55,69 +39,4 @@ class ChartPunctualEvent extends ChartWidget
{
return 'line';
}
// protected function getOptions(): RawJs|array
// {
// return RawJs::make(<<<'JS'
// {
// plugins: {
// legend: {
// display: false
// },
// datalabels: {
// backgroundColor: function(context) {
// return context.active ? context.dataset.backgroundColor : 'white';
// },
// borderColor: function(context) {
// return context.dataset.backgroundColor;
// },
// borderRadius: function(context) {
// return context.active ? 0 : 32;
// },
// borderWidth: 3,
// color: function(context) {
// return context.active ? 'white' : context.dataset.backgroundColor;
// },
// font: {
// weight: 'bold'
// },
// formatter: function(value, context) {
// value = Math.round(value * 100) / 100;
// return context.active
// ? context.dataset.label + '\n' + value + '%'
// : Math.round(value);
// },
// offset: 8,
// padding: 5,
// textAlign: 'center'
// }
// },
// // Core options
// aspectRatio: 5 / 3,
// layout: {
// padding: {
// bottom: 16,
// right: 40,
// left: 8,
// top: 40
// }
// },
// hover: {
// mode: 'index',
// intersect: false
// },
// elements: {
// line: {
// fill: false,
// tension: 0.4
// }
// },
// scales: {
// y: {
// stacked: true
// }
// }
// }
// JS);
// }
}