From 6ef35f0a8ea1290d48f07df7b6b453fb9bb90b51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Sun, 7 Apr 2019 14:45:58 +0200 Subject: [PATCH] Graph: Allow override decimals to fully override (#16414) Override decimals did not fully override auto scaling logic Fixes #16068 --- public/vendor/flot/jquery.flot.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/vendor/flot/jquery.flot.js b/public/vendor/flot/jquery.flot.js index 25507d63089..15a6b067846 100644 --- a/public/vendor/flot/jquery.flot.js +++ b/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.