wip performance
This commit is contained in:
1 parent
f0658cb658
commit
b330f52835
10 files changed
+258
-14
No files matched your search
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
namespace App\Filament\Widgets;
|
||||
|
||||
use App\Filament\Widgets\Data\LoadPerformance;
|
||||
use Filament\Support\RawJs;
|
||||
use Filament\Widgets\ChartWidget;
|
||||
use Filament\Widgets\Concerns\InteractsWithPageFilters;
|
||||
|
||||
class ChartEventPerf extends ChartWidget
|
||||
{
|
||||
use InteractsWithPageFilters;
|
||||
|
||||
protected ?string $heading = 'Events';
|
||||
|
||||
protected ?string $description = 'Performance';
|
||||
|
||||
protected ?string $pollingInterval = null;
|
||||
|
||||
protected bool $isCollapsible = true;
|
||||
|
||||
protected function getData(): array
|
||||
{
|
||||
return LoadPerformance::load($this->filters);
|
||||
}
|
||||
|
||||
protected function getType(): string
|
||||
{
|
||||
return 'line';
|
||||
}
|
||||
|
||||
protected function getOptions(): RawJs
|
||||
{
|
||||
return RawJs::make(<<<'JS'
|
||||
{
|
||||
interaction: {
|
||||
intersect: false,
|
||||
},
|
||||
// plugins: {
|
||||
// tooltip: {
|
||||
// callbacks: {
|
||||
// label: (context) => {
|
||||
// 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: 'Days since today'
|
||||
}
|
||||
},
|
||||
y: {
|
||||
beginAtZero:true,
|
||||
ticks: {
|
||||
callback: function(value, index, ticks) {
|
||||
return value % 1 === 0 ? value : '';
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
JS);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user