This commit is contained in:
salam committed 2026-05-23 13:35:04 +02:00
1 parent b4379efb82
commit 4f63a4ef2c
2 files changed
+38 -17

No files matched your search

@@ -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,
// ],
// ];
// }
}
@@ -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