Skip to content

Commit 8113157

Browse files
committed
fix: fix step calculation to fix non existent data gaps
Signed-off-by: Gabriel Bernal <[email protected]>
1 parent ffa76b4 commit 8113157

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

web/src/components/query-browser.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,8 @@ const formatSeriesValues = (
428428
// shows the missing values as gaps in the line
429429
const start = Number(_.get(newValues, '[0].x'));
430430
const end = Number(_.get(_.last(newValues), 'x'));
431-
const step = span / samples;
431+
// Calculate step in milliseconds, rounded up to the nearest second
432+
const step = Math.ceil(span / samples / 1000) * 1000;
432433
_.range(start, end, step).forEach((t, i) => {
433434
const x = new Date(t);
434435
if (_.get(newValues, [i, 'x']) > x) {

0 commit comments

Comments
 (0)