From 387f31223bc4623ba39a464e5c1ea2fef4099d52 Mon Sep 17 00:00:00 2001 From: dhanabalan Date: Thu, 15 Oct 2026 11:14:20 +0530 Subject: [PATCH] Changed logic in hourly page --- app/Filament/Widgets/ItemOverview.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/Filament/Widgets/ItemOverview.php b/app/Filament/Widgets/ItemOverview.php index 75aeb5ae..965b152c 100644 --- a/app/Filament/Widgets/ItemOverview.php +++ b/app/Filament/Widgets/ItemOverview.php @@ -140,14 +140,15 @@ class ItemOverview extends ChartWidget }, $shiftedKeys); } - $planData = []; - $cumulativeQuantity = 0; + $totalQuantity = array_sum($orderedData); - foreach ($orderedData as $quantity) { - $cumulativeQuantity += $quantity; + $planQuantity = round($totalQuantity / 22.5, 2); - $planData[] = round($cumulativeQuantity / 22.5, 2); - } + $planData = array_fill( + 0, + count($orderedData), + $planQuantity + ); return [ 'datasets' => [