Commit 9316bcf3 by bergquist

fix(singlestat): enables autoupdate on change

closes #4809
closes #4812
parent 60855643
......@@ -278,6 +278,14 @@ class SingleStatCtrl extends MetricsPanelCtrl {
return body;
}
function getValueText() {
var result = panel.prefix ? panel.prefix : '';
result += data.valueFormated;
result += panel.postfix ? panel.postfix : '';
return result;
}
function addGauge() {
var plotCanvas = $('<div></div>');
var plotCss = {
......@@ -332,7 +340,7 @@ class SingleStatCtrl extends MetricsPanelCtrl {
},
value: {
color: panel.colorValue ? getColorForValue(data, data.valueRounded) : null,
formatter: function () { return data.valueFormated; },
formatter: function() { return getValueText(); },
font: { size: getGaugeFontSize() }
},
show: true
......@@ -419,6 +427,7 @@ class SingleStatCtrl extends MetricsPanelCtrl {
function render() {
if (!ctrl.data) { return; }
ctrl.setValues(ctrl.data);
data = ctrl.data;
setElementHeight();
......
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