瀏覽代碼

Graph: Allow override decimals to fully override (#16414)

Override decimals did not fully override auto scaling logic

Fixes #16068
Torkel Ödegaard 6 年之前
父節點
當前提交
6ef35f0a8e
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      public/vendor/flot/jquery.flot.js

+ 4 - 1
public/vendor/flot/jquery.flot.js

@@ -1763,8 +1763,11 @@ Licensed under the MIT license.
             axis.delta = delta;
             axis.tickDecimals = Math.max(0, maxDec != null ? maxDec : dec);
             axis.tickSize = opts.tickSize || size;
+
             // grafana addition
-            axis.scaledDecimals = axis.tickDecimals - Math.floor(Math.log(axis.tickSize) / Math.LN10);
+            if (opts.tickDecimals === null && opts.tickDecimals === undefined) {
+              axis.scaledDecimals = axis.tickDecimals - Math.floor(Math.log(axis.tickSize) / Math.LN10);
+            }
 
             // Time mode was moved to a plug-in in 0.8, and since so many people use it
             // we'll add an especially friendly reminder to make sure they included it.