This commit is contained in:
salam committed 2026-05-27 15:55:46 +02:00
1 parent c329d5a6f5
commit 847fdb80cc
1 file changed
+32
@@ -14,8 +14,12 @@ class ChartPunctualEvent extends ChartWidget
protected ?string $pollingInterval = null; protected ?string $pollingInterval = null;
protected $f;
protected function getData(): array protected function getData(): array
{ {
$this->f = $this->filters;
$this->heading = 'Events'; $this->heading = 'Events';
$data = LoadEvents::load($this->filters); $data = LoadEvents::load($this->filters);
@@ -36,6 +40,10 @@ class ChartPunctualEvent extends ChartWidget
protected function getOptions(): RawJs protected function getOptions(): RawJs
{ {
$filter = $this->f;
switch ($filter['similar_past_matches']) {
case 'none':
return RawJs::make(<<<'JS' return RawJs::make(<<<'JS'
{ {
interaction: { interaction: {
@@ -57,5 +65,29 @@ class ChartPunctualEvent extends ChartWidget
}, },
} }
JS); JS);
default:
return RawJs::make(<<<'JS'
{
interaction: {
intersect: false,
},
plugins: {
tooltip: {
callbacks: {
label: (context) => {
return [context.dataset.events[context.dataIndex], context.dataset.results_per_event[context.dataIndex]];
},
}
},
},
scales: {
y: {
beginAtZero:true,
},
},
}
JS);
break;
}
} }
} }