mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Fix singlestat threshold tooltip (#12109)
fix singlestat threshold tooltip
This commit is contained in:
parent
b379b28337
commit
b894b5e669
@ -61,7 +61,7 @@
|
||||
<div class="gf-form-inline">
|
||||
<div class="gf-form max-width-21">
|
||||
<label class="gf-form-label width-8">Thresholds
|
||||
<tip>Define two threshold values<br /> 50,80 will produce: <50 = Green, 50:80 = Yellow, >80 = Red</tip>
|
||||
<tip>Define two threshold values<br /> 50,80 will produce: value < 50 = Green, 50 <= value < 80 = Yellow, value >= 80 = Red</tip>
|
||||
</label>
|
||||
<input type="text" class="gf-form-input" ng-model="ctrl.panel.thresholds" ng-blur="ctrl.render()" placeholder="50,80"></input>
|
||||
</div>
|
||||
|
@ -714,11 +714,13 @@ function getColorForValue(data, value) {
|
||||
if (!_.isFinite(value)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
for (var i = data.thresholds.length; i > 0; i--) {
|
||||
if (value >= data.thresholds[i - 1]) {
|
||||
return data.colorMap[i];
|
||||
}
|
||||
}
|
||||
|
||||
return _.first(data.colorMap);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user