|
@@ -4,6 +4,7 @@ import isNumber from 'lodash/isNumber';
|
|
|
import { colors } from './colors';
|
|
import { colors } from './colors';
|
|
|
|
|
|
|
|
// Types
|
|
// Types
|
|
|
|
|
+import { getFlotPairs } from './flotPairs';
|
|
|
import { TimeSeriesVMs, NullValueMode, TimeSeriesValue, TableData } from '../types';
|
|
import { TimeSeriesVMs, NullValueMode, TimeSeriesValue, TableData } from '../types';
|
|
|
|
|
|
|
|
interface Options {
|
|
interface Options {
|
|
@@ -34,7 +35,14 @@ export function processTimeSeries({ data, xColumn, yColumn, nullValueMode }: Opt
|
|
|
|
|
|
|
|
const colorIndex = index % colors.length;
|
|
const colorIndex = index % colors.length;
|
|
|
const label = item.columns[yColumn].text;
|
|
const label = item.columns[yColumn].text;
|
|
|
- const result = [];
|
|
|
|
|
|
|
+
|
|
|
|
|
+ // Use external calculator just to make sure it works :)
|
|
|
|
|
+ const result = getFlotPairs({
|
|
|
|
|
+ rows: item.rows,
|
|
|
|
|
+ xIndex: xColumn,
|
|
|
|
|
+ yIndex: yColumn,
|
|
|
|
|
+ nullValueMode,
|
|
|
|
|
+ });
|
|
|
|
|
|
|
|
// stat defaults
|
|
// stat defaults
|
|
|
let total = 0;
|
|
let total = 0;
|
|
@@ -137,8 +145,6 @@ export function processTimeSeries({ data, xColumn, yColumn, nullValueMode }: Opt
|
|
|
allIsZero = false;
|
|
allIsZero = false;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- result.push([currentTime, currentValue]);
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (max === -Number.MAX_VALUE) {
|
|
if (max === -Number.MAX_VALUE) {
|