From cb9becae4e0d2a46eea997dd36e6e265b3649dfb Mon Sep 17 00:00:00 2001 From: Graham McIntie Date: Tue, 24 Mar 2026 08:50:49 -0500 Subject: [PATCH] =?UTF-8?q?fix:=20traffic=20graph=20invisible=20=E2=80=94?= =?UTF-8?q?=20scale=20dominated=20by=20capacity=20lines=20(#140)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Problem On backhaul devices, the Y axis auto-scale includes capacity reference line values (e.g. 100 Mbps) alongside actual traffic (e.g. 5 Mbps). This makes the traffic data appear as a flat line near zero — effectively invisible. ## Fix Exclude datasets with `Capacity` prefix from the max-value calculation used for symmetric Y axis scaling. The capacity dashed lines still render and clip at the chart edges as a visual ceiling reference. ## 1-line change ```js if (dataset.label?.startsWith("Capacity")) return ``` Reviewed-on: https://git.mcintire.me/graham/towerops-web/pulls/140 --- assets/js/app.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/assets/js/app.ts b/assets/js/app.ts index abfe6f97..b1620dd0 100644 --- a/assets/js/app.ts +++ b/assets/js/app.ts @@ -127,8 +127,10 @@ const SensorChart: SensorChartHook = { if (autoScale) { if (showZeroLine && unit === 'bps') { // Find max absolute value to make symmetric scale + // Exclude capacity reference lines so they don't dominate the scale let maxAbsValue = 0 datasets.forEach(dataset => { + if (dataset.label?.startsWith('Capacity')) return if (dataset.data && dataset.data.length > 0) { dataset.data.forEach((point: ChartDataPoint) => { if (point && typeof point.y === 'number') {