Browse Source

[Bug] Coloring Background on siglestat panel #7242 (#8334)

The bug was happening because the background color was being based on
the rounded value (accounting the user defined decimals). Changed it to
use the pure value (not the rounded) to follow whats being done in the
value color, and also in the table thresholds (they don't consider the
decimals when comparing to thresholds).
Suzana Pescador 8 years ago
parent
commit
8c9cc4fae1
1 changed files with 2 additions and 2 deletions
  1. 2 2
      public/app/plugins/panel/singlestat/module.ts

+ 2 - 2
public/app/plugins/panel/singlestat/module.ts

@@ -569,8 +569,8 @@ class SingleStatCtrl extends MetricsPanelCtrl {
 
 
       var body = panel.gauge.show ? '' : getBigValueHtml();
       var body = panel.gauge.show ? '' : getBigValueHtml();
 
 
-      if (panel.colorBackground && !isNaN(data.valueRounded)) {
-        var color = getColorForValue(data, data.valueRounded);
+      if (panel.colorBackground && !isNaN(data.value)) {
+        var color = getColorForValue(data, data.value);
         if (color) {
         if (color) {
           $panelContainer.css('background-color', color);
           $panelContainer.css('background-color', color);
           if (scope.fullscreen) {
           if (scope.fullscreen) {