Commit 0047ce06 by Torkel Ödegaard

SingleStatPanel: fix for color thresholds and value to text mapping combo, Fixes #2044

parent 58f743f8
......@@ -190,7 +190,12 @@ function (angular, app, _, TimeSeries, kbn, PanelMeta) {
data.flotpairs = $scope.series[0].flotpairs;
}
// first check value to text mappings
var decimalInfo = $scope.getDecimalsForValue(data.value);
var formatFunc = kbn.valueFormats[$scope.panel.format];
data.valueFormated = formatFunc(data.value, decimalInfo.decimals, decimalInfo.scaledDecimals);
data.valueRounded = kbn.roundValue(data.value, decimalInfo.decimals);
// check value to text mappings
for(var i = 0; i < $scope.panel.valueMaps.length; i++) {
var map = $scope.panel.valueMaps[i];
// special null case
......@@ -201,6 +206,7 @@ function (angular, app, _, TimeSeries, kbn, PanelMeta) {
}
continue;
}
// value/number to text mapping
var value = parseFloat(map.value);
if (value === data.value) {
......@@ -212,11 +218,6 @@ function (angular, app, _, TimeSeries, kbn, PanelMeta) {
if (data.value === null || data.value === void 0) {
data.valueFormated = "no value";
}
var decimalInfo = $scope.getDecimalsForValue(data.value);
var formatFunc = kbn.valueFormats[$scope.panel.format];
data.valueFormated = formatFunc(data.value, decimalInfo.decimals, decimalInfo.scaledDecimals);
data.valueRounded = kbn.roundValue(data.value, decimalInfo.decimals);
};
$scope.removeValueMap = function(map) {
......
......@@ -19,7 +19,7 @@
<form name="loginForm" class="login-form">
<div class="tight-form" ng-if="loginMode">
<ul class="tight-form-list">
<li class="tight-form-item" style="width: 80px">
<li class="tight-form-item" style="width: 78px">
<strong>User</strong>
</li>
<li>
......@@ -30,7 +30,7 @@
</div>
<div class="tight-form" ng-if="loginMode">
<ul class="tight-form-list">
<li class="tight-form-item" style="width: 80px">
<li class="tight-form-item" style="width: 78px">
<strong>Password</strong>
</li>
<li>
......
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