From a3f4bfaa3d2cb607f58e950ab927c7d60f5fadc5 Mon Sep 17 00:00:00 2001 From: "manuel.montes" Date: Wed, 7 Nov 2018 13:57:47 +0100 Subject: [PATCH] Implemented limitation decimals in y-axis realtime graphs --- .../extensions/realtime_graphs/realtime_graphs.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pandora_console/extensions/realtime_graphs/realtime_graphs.js b/pandora_console/extensions/realtime_graphs/realtime_graphs.js index 34da7b1704..924331cafe 100644 --- a/pandora_console/extensions/realtime_graphs/realtime_graphs.js +++ b/pandora_console/extensions/realtime_graphs/realtime_graphs.js @@ -30,7 +30,7 @@ }, yaxis: { tickFormatter: function (value, axis) { - return shortNumber(value); + return shortNumber(roundToTwo(value)) ; } }, series: { @@ -178,6 +178,9 @@ return number + " " + shorts[pos]; } + function roundToTwo(num) { + return +(Math.round(num + "e+2") + "e-2"); + } $('#graph').change(function() { $('form#realgraph').submit();