Events Performance
' . $this->type . 'Moving Average
');
}
protected function getData(): array
{
$data = LoadPerformance::load($this->filters, false);
if ($data) {
HelperMoveingAveragePerformens::get($data);
}
return $data;
}
protected function getType(): string
{
return 'line';
}
protected function getOptions(): RawJs
{
return RawJs::make(<<<'JS'
{
interaction: {
intersect: false,
},
plugins: {
legend: {
position: 'left',
maxWidth: ({chart}) => chart.width * 0.9
},
tooltip: {
callbacks: {
label: (context) => {
if(context.dataset.label == 'Average Team' || context.dataset.label == 'Average Attak'|| context.dataset.label == 'Average Denfence'|| context.dataset.label == 'Average Midfield'){
return [context.dataset.label+' '+context.dataset.data[0]];
}
else {
return [' '+context.parsed.y, ' '+context.dataset.playing_date[context.dataIndex], ' '+context.dataset.events[context.dataIndex], ' '+context.dataset.results_per_event[context.dataIndex]];
}
},
}
}
},
scales: {
x: {
title: {
display: true,
text: 'Number of days to date'
}
},
},
}
JS);
}
}