set the unit on time data

This commit is contained in:
ryan
2019-03-13 22:31:54 -07:00
parent 734a209535
commit 4600aac7d5
2 changed files with 4 additions and 3 deletions

View File

@@ -51,9 +51,9 @@ export enum NullValueMode {
export type TimeSeriesVMs = TimeSeriesVM[]; export type TimeSeriesVMs = TimeSeriesVM[];
export interface Column { export interface Column {
text: string; // name text: string; // The column name
type?: 'time' | 'number' | 'string' | 'object'; type?: 'time' | 'number' | 'string' | 'object'; // not used anywhere? can we remove?
filterable?: boolean; filterable?: boolean; // currently only set by elasticsearch, and used in the table panel
unit?: string; unit?: string;
} }

View File

@@ -139,6 +139,7 @@ function convertTimeSeriesToTableData(timeSeries: TimeSeries): TableData {
{ {
text: 'Time', text: 'Time',
type: 'time', type: 'time',
unit: 'dateTimeAsIso',
}, },
], ],
rows: timeSeries.datapoints, rows: timeSeries.datapoints,