Commit c7e7a0cd by Torkel Ödegaard

fix(singlestat): rerender singlestat and reevaluate thresholds on render, fixes #4920

parent 70f71770
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment