1
0
forked from poc/pds

Changed logic in hourly page

This commit is contained in:
dhanabalan
2026-10-15 11:14:20 +05:30
parent 8ffbaf3742
commit 387f31223b

View File

@@ -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' => [