We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6632b8b commit a46dd96Copy full SHA for a46dd96
src/core/core.ticks.js
@@ -49,7 +49,9 @@ module.exports = {
49
var maxTick = Math.max(Math.abs(ticks[0]), Math.abs(ticks[ticks.length - 1]));
50
if (maxTick < 1e-4) { // all ticks are small numbers; use scientific notation
51
var logTick = helpers.log10(Math.abs(tickValue));
52
- tickString = tickValue.toExponential(Math.floor(logTick) - Math.floor(logDelta));
+ var numExponential = Math.floor(logTick) - Math.floor(logDelta);
53
+ numExponential = Math.max(Math.min(numExponential, 20), 0);
54
+ tickString = tickValue.toExponential(numExponential);
55
} else {
56
var numDecimal = -1 * Math.floor(logDelta);
57
numDecimal = Math.max(Math.min(numDecimal, 20), 0); // toFixed has a max of 20 decimal places
0 commit comments