Commit 47da3e3a by Tobias Skarhed

All tests passing

parent 675a031b
......@@ -310,14 +310,10 @@ class SingleStatCtrl extends MetricsPanelCtrl {
data.valueRounded = data.value;
data.valueFormatted = formatFunc(data.value, this.dashboard.isTimezoneUtc());
} else {
// console.log(lastPoint, lastValue);
// console.log(this.panel.valueName);
// console.log(this.panel);
data.value = this.series[0].stats[this.panel.valueName];
data.flotpairs = this.series[0].flotpairs;
let decimalInfo = this.getDecimalsForValue(data.value);
console.log(decimalInfo);
let formatFunc = kbn.valueFormats[this.panel.format];
data.valueFormatted = formatFunc(data.value, decimalInfo.decimals, decimalInfo.scaledDecimals);
data.valueRounded = kbn.roundValue(data.value, decimalInfo.decimals);
......
......@@ -293,6 +293,7 @@ describe('SingleStatCtrl', function() {
ctx.setup(function() {
ctx.data = tableData;
ctx.data[0].rows[0] = [1492759673649, 'ignore1', 99.99999, 'ignore2'];
ctx.ctrl.panel.mappingType = 0;
ctx.ctrl.panel.tableColumn = 'mean';
});
......@@ -310,6 +311,7 @@ describe('SingleStatCtrl', function() {
ctx.setup(function() {
ctx.data = tableData;
ctx.data[0].rows[0] = [1492759673649, 'ignore1', 9.9, 'ignore2'];
ctx.ctrl.panel.mappingType = 2;
ctx.ctrl.panel.tableColumn = 'mean';
ctx.ctrl.panel.valueMaps = [{ value: '10', text: 'OK' }];
});
......
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