statistic wip
This commit is contained in:
1 parent
01a3f41ec0
commit
d6620fb0a1
10 files changed
+408
-333
No files matched your search
@@ -3,7 +3,6 @@
|
||||
namespace App\Filament\Pages;
|
||||
|
||||
use App\Actions\LoadStatisticFixturesLeaguesOptions;
|
||||
use App\Actions\Statistics\StatisticEvents;
|
||||
use App\Filament\Widgets\MovingAverageChart;
|
||||
use App\Filament\Widgets\PunctualChart;
|
||||
use App\Models\Element;
|
||||
@@ -27,21 +26,6 @@ class Statistic extends BaseDashboard
|
||||
|
||||
protected static ?string $title = 'Statistic';
|
||||
|
||||
protected static array $types = [
|
||||
'gls' => 'Goals',
|
||||
'crn' => 'Corner',
|
||||
'fls' => 'Fouls commited',
|
||||
'ofs' => 'Offside',
|
||||
'crd' => 'Cards',
|
||||
'snt' => 'Shot on target',
|
||||
'tsh' => 'Total shots',
|
||||
];
|
||||
|
||||
public function getColumns(): int|array
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
public function filtersForm(Schema $schema): Schema
|
||||
{
|
||||
return $schema
|
||||
@@ -153,26 +137,16 @@ class Statistic extends BaseDashboard
|
||||
]);
|
||||
}
|
||||
|
||||
public function update()
|
||||
{
|
||||
dd($this->filter);
|
||||
}
|
||||
|
||||
protected function getFooterWidgets(): array
|
||||
{
|
||||
|
||||
$data = StatisticEvents::load($this->filters);
|
||||
|
||||
$type = self::$types[$this->filters['statistic_type']];
|
||||
|
||||
// $data = [
|
||||
// 'datasets' => [
|
||||
// [
|
||||
// 'label' => 'test',
|
||||
// 'data' => [0, 10, 5, 2, 21, 32, 45, 74, 65, 45, 77, 89],
|
||||
// ],
|
||||
// ],
|
||||
// 'labels' => ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
|
||||
// ];
|
||||
|
||||
return [
|
||||
MovingAverageChart::make(['filters' => $data, 'header' => $type.' Punctual']),
|
||||
PunctualChart::make(['filters' => $data, 'header' => $type.' Moving Avverage']),
|
||||
PunctualChart::make(),
|
||||
MovingAverageChart::make(),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user