From 4f63a4ef2c60de8300ee7449b3e54a9ce53c3b73 Mon Sep 17 00:00:00 2001 From: salam Date: Sat, 23 May 2026 13:35:04 +0200 Subject: [PATCH] wip --- .../Widgets/ChartMovingAverageEvent.php | 45 ++++++++++++------- app/Filament/Widgets/ChartPunctualEvent.php | 10 +++++ 2 files changed, 38 insertions(+), 17 deletions(-) diff --git a/app/Filament/Widgets/ChartMovingAverageEvent.php b/app/Filament/Widgets/ChartMovingAverageEvent.php index 936616db..820ea7a1 100644 --- a/app/Filament/Widgets/ChartMovingAverageEvent.php +++ b/app/Filament/Widgets/ChartMovingAverageEvent.php @@ -22,23 +22,6 @@ class ChartMovingAverageEvent extends ChartWidget 'legend' => [ 'display' => false, ], - 'tooltip' => [ - 'callbacks' => [ - 'label' => RawJs::make(<<<'JS' - function(context) { - let label = context.dataset.label || ''; - - if (label) { - label += ': '; - } - if (context.parsed.y !== null) { - label += new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(context.parsed.y); - } - return label; - } - JS), - ], - ], ], 'interaction' => [ 'intersect' => false, @@ -67,4 +50,32 @@ class ChartMovingAverageEvent extends ChartWidget { return 'line'; } + + // protected function getOptions(): array|RawJs|null + // { + // return [ + // 'plugins' => [ + // 'legend' => [ + // 'display' => display, + // ], + // 'tooltip' => [ + // 'callbacks' => [ + // 'label' => RawJs::make(<<<'JS' + // function(context) { + // let label = context.dataset.label || ''; + + // if (label) { + // label += ': '; + // } + // return label; + // } + // JS), + // ], + // ], + // ], + // 'interaction' => [ + // 'intersect' => false, + // ], + // ]; + // } } diff --git a/app/Filament/Widgets/ChartPunctualEvent.php b/app/Filament/Widgets/ChartPunctualEvent.php index 40736e5e..e6b6aad7 100644 --- a/app/Filament/Widgets/ChartPunctualEvent.php +++ b/app/Filament/Widgets/ChartPunctualEvent.php @@ -25,6 +25,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