Implemented limitation decimals in y-axis realtime graphs

This commit is contained in:
manuel.montes 2018-11-07 13:57:47 +01:00
parent 9c143d1d00
commit a3f4bfaa3d

View File

@ -30,7 +30,7 @@
}, },
yaxis: { yaxis: {
tickFormatter: function (value, axis) { tickFormatter: function (value, axis) {
return shortNumber(value); return shortNumber(roundToTwo(value)) ;
} }
}, },
series: { series: {
@ -178,6 +178,9 @@
return number + " " + shorts[pos]; return number + " " + shorts[pos];
} }
function roundToTwo(num) {
return +(Math.round(num + "e+2") + "e-2");
}
$('#graph').change(function() { $('#graph').change(function() {
$('form#realgraph').submit(); $('form#realgraph').submit();