|
@@ -4,7 +4,7 @@ import React, { PureComponent, CSSProperties } from 'react';
|
|
|
// Types
|
|
// Types
|
|
|
import { SingleStatOptions, SingleStatBaseOptions } from './types';
|
|
import { SingleStatOptions, SingleStatBaseOptions } from './types';
|
|
|
|
|
|
|
|
-import { DisplayValue, PanelProps, processTimeSeries, NullValueMode, guessColumnTypes } from '@grafana/ui';
|
|
|
|
|
|
|
+import { DisplayValue, PanelProps, processTimeSeries, NullValueMode, guessColumnTypes, ColumnType } from '@grafana/ui';
|
|
|
import { config } from 'app/core/config';
|
|
import { config } from 'app/core/config';
|
|
|
import { getDisplayProcessor } from '@grafana/ui';
|
|
import { getDisplayProcessor } from '@grafana/ui';
|
|
|
import { ProcessedValuesRepeater } from './ProcessedValuesRepeater';
|
|
import { ProcessedValuesRepeater } from './ProcessedValuesRepeater';
|
|
@@ -25,13 +25,13 @@ export const getSingleStatValues = (props: PanelProps<SingleStatBaseOptions>): D
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
const values: DisplayValue[] = [];
|
|
const values: DisplayValue[] = [];
|
|
|
- data.forEach(t => {
|
|
|
|
|
- const table = guessColumnTypes(t);
|
|
|
|
|
|
|
+ for (let t = 0; t < data.length; t++) {
|
|
|
|
|
+ const table = guessColumnTypes(data[t]);
|
|
|
for (let i = 0; i < table.columns.length; i++) {
|
|
for (let i = 0; i < table.columns.length; i++) {
|
|
|
const column = table.columns[i];
|
|
const column = table.columns[i];
|
|
|
|
|
|
|
|
// Show all columns that are not 'time'
|
|
// Show all columns that are not 'time'
|
|
|
- if (column.type === 'number') {
|
|
|
|
|
|
|
+ if (column.type === ColumnType.number) {
|
|
|
const series = processTimeSeries({
|
|
const series = processTimeSeries({
|
|
|
data: [table],
|
|
data: [table],
|
|
|
xColumn: i,
|
|
xColumn: i,
|
|
@@ -43,7 +43,7 @@ export const getSingleStatValues = (props: PanelProps<SingleStatBaseOptions>): D
|
|
|
values.push(processor(value));
|
|
values.push(processor(value));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
if (values.length === 0) {
|
|
if (values.length === 0) {
|
|
|
throw { message: 'Could not find numeric data' };
|
|
throw { message: 'Could not find numeric data' };
|