Skip to content

Commit 4257a32

Browse files
Merge pull request #655 from jgbernalp/fix-step-calculation-for-metric-explorer-4.19
OU-863: [release-4.19]: Fix step calculation for metric explorer 4.19
2 parents 9f7013e + 8113157 commit 4257a32

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
@@ -432,7 +432,8 @@ const formatSeriesValues = (
432432
// shows the missing values as gaps in the line
433433
const start = Number(_.get(newValues, '[0].x'));
434434
const end = Number(_.get(_.last(newValues), 'x'));
435-
const step = span / samples;
435+
// Calculate step in milliseconds, rounded up to the nearest second
436+
const step = Math.ceil(span / samples / 1000) * 1000;
436437
_.range(start, end, step).forEach((t, i) => {
437438
const x = new Date(t);
438439
if (_.get(newValues, [i, 'x']) > x) {

0 commit comments

Comments
 (0)