Merge branch '2992-Realtime-Graph-decimales' into 'develop'

Implemented limitation decimals in y-axis realtime graphs

See merge request artica/pandorafms!1941

Former-commit-id: 0ca73da98323fa3880cccd96d12150228ce2dead
This commit is contained in:
vgilc 2018-12-21 10:25:57 +01:00
commit b9fd907933
1 changed files with 4 additions and 1 deletions

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();