From 8ac3f0189159b74e1209adae404ec18a9babec9a Mon Sep 17 00:00:00 2001 From: Alexandr Velikiy <39257464+VargBurz@users.noreply.github.com> Date: Thu, 3 Oct 2019 14:49:36 +0300 Subject: [PATCH] Panels are not rendered without a refresh sometimes #223 (#383) * add check for undefined * check on top * render --- src/panel/graph_panel/graph_ctrl.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/panel/graph_panel/graph_ctrl.ts b/src/panel/graph_panel/graph_ctrl.ts index 081489d..0ecd0f4 100644 --- a/src/panel/graph_panel/graph_ctrl.ts +++ b/src/panel/graph_panel/graph_ctrl.ts @@ -324,6 +324,7 @@ class GraphCtrl extends MetricsPanelCtrl { this.$graphElem, this.timeSrv, this.contextSrv, this.$scope, this.analyticsController ); this._graphLegend = new GraphLegend(this.$legendElem, this.popoverSrv, this.$scope, this.analyticsController); + this.onRender(); } issueQueries(datasource) { @@ -422,7 +423,7 @@ class GraphCtrl extends MetricsPanelCtrl { } onRender() { - if(!this.seriesList) { + if(!this.seriesList || !this._graphRenderer || !this._graphLegend) { return; }