From c7e7a0cd16a9e5e8794b3359f4c50887314b4317 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Thu, 5 May 2016 10:29:14 +0200 Subject: [PATCH] fix(singlestat): rerender singlestat and reevaluate thresholds on render, fixes #4920 --- public/app/plugins/panel/singlestat/module.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/public/app/plugins/panel/singlestat/module.ts b/public/app/plugins/panel/singlestat/module.ts index de18d7b8d2e..9fa3e8e39c6 100644 --- a/public/app/plugins/panel/singlestat/module.ts +++ b/public/app/plugins/panel/singlestat/module.ts @@ -91,11 +91,6 @@ class SingleStatCtrl extends MetricsPanelCtrl { var data: any = {}; this.setValues(data); - data.thresholds = this.panel.thresholds.split(',').map(function(strVale) { - return Number(strVale.trim()); - }); - - data.colorMap = this.panel.colors; this.data = data; this.render(); } @@ -435,8 +430,14 @@ class SingleStatCtrl extends MetricsPanelCtrl { function render() { if (!ctrl.data) { return; } - ctrl.setValues(ctrl.data); data = ctrl.data; + + // get thresholds + data.thresholds = panel.thresholds.split(',').map(function(strVale) { + return Number(strVale.trim()); + }); + data.colorMap = panel.colors; + setElementHeight(); var body = panel.gauge.show ? '' : getBigValueHtml();