瀏覽代碼

Fix gauge display accuracy for "percent (0.0-1.0)"

The "Decimals" value was incorrectly applied to the metric value used to calculate the gauge display in addition to the text value (so a "Decimals" value of "1" turns "45.1%" into "50%" in the gauge display even though the label still correctly says "45.1%").
Tianon Gravi 7 年之前
父節點
當前提交
74912dca8d
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      public/app/plugins/panel/singlestat/module.ts

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

@@ -544,7 +544,7 @@ class SingleStatCtrl extends MetricsPanelCtrl {
       elem.append(plotCanvas);
       elem.append(plotCanvas);
 
 
       const plotSeries = {
       const plotSeries = {
-        data: [[0, data.valueRounded]],
+        data: [[0, data.value]],
       };
       };
 
 
       $.plot(plotCanvas, [plotSeries], options);
       $.plot(plotCanvas, [plotSeries], options);