Browse Source

set the unit on time data

ryan 6 years ago
parent
commit
4600aac7d5

+ 3 - 3
packages/grafana-ui/src/types/data.ts

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

+ 1 - 0
packages/grafana-ui/src/utils/processTableData.ts

@@ -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,