Use localestring to ensure maximum fraction digits on graph ticks of 6 instead of always rounding

This commit is contained in:
Johannes Zellner
2022-10-21 13:27:31 +02:00
parent e2861f5756
commit 6d0557a152
+4 -1
View File
@@ -791,7 +791,10 @@ angular.module('Application').controller('AppController', ['$scope', '$location'
}
};
if (format) options.scales.y.ticks.callback = function (value) { return (formatDivisor ? (value/formatDivisor) : value).toFixed(2) + ' ' + format; };
if (format) options.scales.y.ticks.callback = function (value) {
if (!formatDivisor) return value + ' ' + format;
return (value/formatDivisor).toLocaleString('en-US', { maximumFractionDigits: 6 }) + ' ' + format;
};
if (max) options.scales.y.max = max;
if (stepSize) options.scales.y.ticks.stepSize = stepSize;