wip design
This commit is contained in:
1 parent
a862442e9f
commit
bf2aa801fc
13 files changed
+283
-266
No files matched your search
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Widgets;
|
||||
|
||||
use App\Filament\Widgets\Data\HelperMoveingAverage;
|
||||
use App\Filament\Widgets\Data\HelperStatisticType;
|
||||
use App\Filament\Widgets\Data\LoadPlayer;
|
||||
use Filament\Widgets\ChartWidget;
|
||||
use Filament\Widgets\Concerns\InteractsWithPageFilters;
|
||||
|
||||
class ChartPlayerMoAv extends ChartWidget
|
||||
{
|
||||
use InteractsWithPageFilters;
|
||||
|
||||
protected ?string $pollingInterval = null;
|
||||
|
||||
protected bool $isCollapsible = true;
|
||||
|
||||
public ?string $header;
|
||||
|
||||
protected ?array $options = [
|
||||
'plugins' => [
|
||||
'legend' => [
|
||||
'display' => false,
|
||||
],
|
||||
],
|
||||
'interaction' => [
|
||||
'intersect' => false,
|
||||
],
|
||||
'scales' => [
|
||||
'y' => [
|
||||
'beginAtZero' => true,
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
protected function getData(): array
|
||||
{
|
||||
if ($this->filters['statistic_type'] == 'crn') {
|
||||
return [];
|
||||
}
|
||||
|
||||
$this->heading = 'Player';
|
||||
|
||||
$this->description = ucfirst(HelperStatisticType::get($this->filters)).' Moving Average';
|
||||
|
||||
$data = LoadPlayer::load($this->filters);
|
||||
|
||||
if ($data) {
|
||||
HelperMoveingAverage::get($data);
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
protected function getType(): string
|
||||
{
|
||||
return 'line';
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user