Added line stop chart
This commit is contained in:
42
app/Filament/Widgets/ProductionLineStopChart.php
Normal file
42
app/Filament/Widgets/ProductionLineStopChart.php
Normal file
@@ -0,0 +1,42 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user