From ba99a8ef2612b07a6ca5de18b4617a74efcbdcab Mon Sep 17 00:00:00 2001 From: rozetko Date: Tue, 4 Jun 2019 10:45:40 +0300 Subject: [PATCH] Double legend and tooltip for HSR #316 && HSR is shown in future #317 (#330) --- src/panel/graph_panel/graph_ctrl.ts | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/panel/graph_panel/graph_ctrl.ts b/src/panel/graph_panel/graph_ctrl.ts index bc86d3e..d82c26d 100644 --- a/src/panel/graph_panel/graph_ctrl.ts +++ b/src/panel/graph_panel/graph_ctrl.ts @@ -365,10 +365,6 @@ class GraphCtrl extends MetricsPanelCtrl { const { from, to } = this.rangeTimestamp; - if(this.analyticsController !== undefined) { - const hsrSeries = await this.analyticsController.getHSRSeries(from, to); - this.dataList = _.concat(this.dataList, hsrSeries); - } this.seriesList = this.processor.getSeriesList({ dataList: this.dataList, range: this.range, @@ -402,6 +398,19 @@ class GraphCtrl extends MetricsPanelCtrl { } if(this.analyticsController !== undefined) { + let { from, to } = this.rangeTimestamp; + if(!_.isEmpty(this._dataTimerange)) { + from = this._dataTimerange.from; + to = this._dataTimerange.to; + } + const hsrData = await this.analyticsController.getHSRSeries(from, to); + + const hsrSeries = this.processor.getSeriesList({ + dataList: hsrData, + range: this.range, + }); + this.seriesList = _.concat(this.seriesList, hsrSeries); + await this.analyticsController.fetchAnalyticUnitsSegments(from, to); // TODO: make statuses and detection spans connected this.analyticsController.fetchAnalyticUnitsStatuses(); @@ -423,7 +432,7 @@ class GraphCtrl extends MetricsPanelCtrl { } for(let series of this.seriesList) { - if (series.unit) { + if(series.unit) { this.panel.yaxes[series.yaxis - 1].format = series.unit; } }