43 lines
1018 B
PHP
43 lines
1018 B
PHP
<?php
|
|
|
|
namespace App\Filament\Widgets;
|
|
|
|
use Filament\Widgets\ChartWidget;
|
|
|
|
class ProductionLineStopChart extends ChartWidget
|
|
{
|
|
protected static ?string $heading = 'Production Line Stop Chart';
|
|
|
|
protected static ?string $maxHeight = '250px';
|
|
|
|
protected function getData(): array
|
|
{
|
|
return [
|
|
'datasets' => [
|
|
[
|
|
'label' => 'Production by Category',
|
|
'data' => [25, 40, 20, 15],
|
|
'backgroundColor' => [
|
|
'#f87171', // Red
|
|
'#60a5fa', // Blue
|
|
'#34d399', // Green
|
|
'#fbbf24', // Yellow
|
|
],
|
|
],
|
|
],
|
|
'labels' => ['Line A', 'Line B', 'Line C', 'Line D'],
|
|
];
|
|
}
|
|
|
|
protected function getType(): string
|
|
{
|
|
return 'doughnut';
|
|
}
|
|
|
|
public static function canView(): bool
|
|
{
|
|
// Only show on HourlyProduction page
|
|
return request()->routeIs('filament.pages.production-line-stop-count');
|
|
}
|
|
}
|