Updated session plant and line and overriding issue solved
This commit is contained in:
@@ -3,7 +3,10 @@
|
||||
namespace App\Filament\Widgets;
|
||||
|
||||
use Filament\Notifications\Notification;
|
||||
use Filament\Support\Assets\Js;
|
||||
use Filament\Support\RawJs;
|
||||
use Filament\Widgets\ChartWidget;
|
||||
use Illuminate\Contracts\View\View;
|
||||
|
||||
class ItemOverview extends ChartWidget
|
||||
{
|
||||
@@ -16,7 +19,7 @@ class ItemOverview extends ChartWidget
|
||||
protected $listeners = ['filtersUpdated' => '$refresh'];
|
||||
|
||||
|
||||
protected function getData(): array
|
||||
public function getData(): array
|
||||
{
|
||||
$activeFilter = $this->filter;
|
||||
|
||||
@@ -156,6 +159,11 @@ class ItemOverview extends ChartWidget
|
||||
default => "Today's Hourly Production",
|
||||
},
|
||||
'data' => $orderedData,
|
||||
'interaction' => [
|
||||
'mode' => 'nearest',
|
||||
'axis' => 'x',
|
||||
'intersect' => false,
|
||||
],
|
||||
'borderColor' => 'rgba(75, 192, 192, 1)',
|
||||
'backgroundColor' => 'rgba(75, 192, 192, 0.2)',
|
||||
'fill' => false,
|
||||
@@ -171,7 +179,6 @@ class ItemOverview extends ChartWidget
|
||||
return 'line';
|
||||
}
|
||||
|
||||
|
||||
protected function getOptions(): array
|
||||
{
|
||||
return [
|
||||
@@ -187,6 +194,33 @@ class ItemOverview extends ChartWidget
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
// protected function getOptions(): array
|
||||
// {
|
||||
// return [
|
||||
// 'plugins' => [
|
||||
// 'datalabels' => [
|
||||
// 'color' => '#3490dc',
|
||||
// 'font' => [
|
||||
// 'weight' => 'bold',
|
||||
// 'size' => 14,
|
||||
// ],
|
||||
// 'backgroundColor' => 'rgba(255,255,255,0.8)',
|
||||
// 'borderRadius' => 4,
|
||||
// 'formatter' => \Illuminate\Support\Js::from(
|
||||
// new Js('function(value, context) {
|
||||
// if (Number(value) === 0) {
|
||||
// return null;
|
||||
// }
|
||||
// return "Count: " + value;
|
||||
// }')
|
||||
// ),
|
||||
// ]
|
||||
// ]
|
||||
// ];
|
||||
// }
|
||||
|
||||
|
||||
protected function getFilters(): ?array
|
||||
{
|
||||
return [
|
||||
@@ -199,7 +233,6 @@ class ItemOverview extends ChartWidget
|
||||
|
||||
public static function canView(): bool
|
||||
{
|
||||
// Only show on HourlyProduction page
|
||||
return request()->routeIs([
|
||||
'filament.pages.hourly-production',
|
||||
'filament.admin.resources.production-quantities.create',
|
||||
|
||||
Reference in New Issue
Block a user