Make sure calculated interval is an integer, fixes #1320
This commit is contained in:
@@ -119,7 +119,7 @@ function getAggFunc(timeFrom, timeTill, options) {
|
|||||||
// the resulting first and last data points will yield invalid values in the
|
// the resulting first and last data points will yield invalid values in the
|
||||||
// calculated average value in downsampleSeries - when using consolidateBy(avg)
|
// calculated average value in downsampleSeries - when using consolidateBy(avg)
|
||||||
const numOfIntervals = Math.ceil((timeTill - timeFrom) / intervalSec);
|
const numOfIntervals = Math.ceil((timeTill - timeFrom) / intervalSec);
|
||||||
intervalSec = (timeTill - timeFrom) / numOfIntervals;
|
intervalSec = Math.ceil((timeTill - timeFrom) / numOfIntervals);
|
||||||
|
|
||||||
consolidateBy = consolidateBy || 'avg';
|
consolidateBy = consolidateBy || 'avg';
|
||||||
const aggFunction = dbConnector.consolidateByFunc[consolidateBy];
|
const aggFunction = dbConnector.consolidateByFunc[consolidateBy];
|
||||||
|
|||||||
Reference in New Issue
Block a user