1
0
forked from poc/pds
Files
poc-pds1/app/Filament/Widgets/ProductionLineStopChart.php
2025-04-24 10:28:36 +05:30

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');
}
}