TimeSeries: Add data frame index and field name (#19005)

This commit is contained in:
Dominik Prokop
2019-09-12 08:47:18 +02:00
committed by GitHub
parent c2dea633e6
commit 0994350e8b
3 changed files with 40 additions and 3 deletions

View File

@@ -67,9 +67,21 @@ export function getDataMinMax(data: TimeSeries[]) {
return { datamin, datamax };
}
/**
* @deprecated: This class should not be used in new panels
*
* Use DataFrame and helpers instead
*/
export default class TimeSeries {
datapoints: any;
id: string;
// Represents index of original data frame in the quey response
dataFrameIndex: number;
/**
* Name of the field the time series was created from
* Used in graph panel to retrieve value from the original data frame
*/
fieldName: string;
label: string;
alias: string;
aliasEscaped: string;
@@ -110,6 +122,8 @@ export default class TimeSeries {
this.stats = {};
this.legend = true;
this.unit = opts.unit;
this.fieldName = opts.fieldName;
this.dataFrameIndex = opts.dataFrameIndex;
this.hasMsResolution = this.isMsResolutionNeeded();
}