'.$this->player.' '.$this->type.' '); } protected function getData(): array { $data = LoadPlayer::load($this->filters); if ($data) { $this->player = $data['player_name'] ?? ''; $this->type = ucfirst(HelperStatisticType::get($this->filters)); HelperMoveingAverage::get($data); } return $data; } protected function getType(): string { return 'line'; } protected function getOptions(): RawJs { return RawJs::make(<<<'JS' { interaction: { intersect: false, }, plugins: { tooltip: { callbacks: { afterLabel: (context) => { let event = context.dataset.events[context.dataIndex] || ''; let date = context.dataset.dates[context.dataIndex] || ''; return event+' '+ date; }, } } }, scales: { x: { title: { display: true, text: 'Days since today' } }, y: { beginAtZero:true, ticks: { callback: function(value, index, ticks) { return value % 1 === 0 ? value : ''; } } }, }, } JS); } }