filters); if ($data) { $this->description = 'Moving Average '.$data['player_name']; 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); } }