Skip to content

Commit 13d899e

Browse files
committed
fix(cm): use 40ms Y-axis floor and guard against zero dataMax
Fixes graph disappearing on all-timeout samples (dataMax=0) and overly tight scaling at low latencies. 40ms floor keeps the green threshold zone visible with breathing room for typical 5-20ms values.
1 parent 9a2790f commit 13d899e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

app/modules/connection_monitor/static/js/connection-monitor-charts.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -240,12 +240,12 @@ var CMCharts = (function() {
240240
datasets.forEach(function(ds) {
241241
ds.data.forEach(function(v) { if (v != null && v > dataMax) dataMax = v; });
242242
});
243-
// Snap to next threshold zone boundary for clean visuals
243+
// 40ms floor ensures green zone is always visible with breathing room.
244+
// Above 30ms: moderate headroom. Above 100ms: tighter headroom.
244245
var yMax;
245-
if (dataMax <= 30) yMax = Math.max(dataMax * 1.3, 10);
246-
else if (dataMax <= 100) yMax = Math.min(dataMax * 1.2, 120);
247-
else yMax = dataMax * 1.15;
248-
yMax = Math.ceil(yMax);
246+
if (dataMax <= 30) yMax = 40;
247+
else if (dataMax <= 100) yMax = Math.ceil(dataMax * 1.2);
248+
else yMax = Math.ceil(dataMax * 1.15);
249249

250250
// PingPlotter-style threshold zones (vertically scaled backgrounds)
251251
// lineColor: transparent suppresses the dashed boundary lines

0 commit comments

Comments
 (0)