f = $this->filters; $this->heading = 'Events'; $data = LoadEvents::load($this->filters); $this->description = ucfirst(HelperStatisticType::get($this->filters)); if (isset($data['description'])) { $this->description .= $data['description']; } return $data; } protected function getType(): string { return 'line'; } protected function getOptions(): RawJs { $filter = $this->f; switch ($filter['similar_past_matches']) { case 'none': return RawJs::make(<<<'JS' { interaction: { intersect: false, }, plugins: { tooltip: { callbacks: { label: (context) => { return [' '+context.parsed.y, context.dataset.events[context.dataIndex], context.dataset.results_per_event[context.dataIndex]]; }, } }, }, scales: { y: { beginAtZero:true, }, }, } 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; } } }