From 8113157c120a4714bcff9db4164462de95b55630 Mon Sep 17 00:00:00 2001 From: Gabriel Bernal Date: Tue, 25 Nov 2025 09:21:26 +0100 Subject: [PATCH] fix: fix step calculation to fix non existent data gaps Signed-off-by: Gabriel Bernal --- web/src/components/query-browser.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/web/src/components/query-browser.tsx b/web/src/components/query-browser.tsx index 9c845c06..801301bb 100644 --- a/web/src/components/query-browser.tsx +++ b/web/src/components/query-browser.tsx @@ -428,7 +428,8 @@ const formatSeriesValues = ( // shows the missing values as gaps in the line const start = Number(_.get(newValues, '[0].x')); const end = Number(_.get(_.last(newValues), 'x')); - const step = span / samples; + // Calculate step in milliseconds, rounded up to the nearest second + const step = Math.ceil(span / samples / 1000) * 1000; _.range(start, end, step).forEach((t, i) => { const x = new Date(t); if (_.get(newValues, [i, 'x']) > x) {