Skip to content

Commit 765ca5a

Browse files
committed
avoid log 0
1 parent 38cd9e2 commit 765ca5a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/plots/cartesian/axes.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@ function autoTickRound(ax) {
839839
// 2 digits past largest digit of dtick
840840
ax._tickround = 2 - Math.floor(Math.log(dtick) / Math.LN10 + 0.01);
841841

842-
var maxend = Math.max(Math.abs(rng[0]), Math.abs(rng[1]));
842+
var maxend = Math.max(Math.abs(rng[0]), Math.abs(rng[1])) || 1;
843843

844844
var rangeexp = Math.floor(Math.log(maxend) / Math.LN10 + 0.01);
845845
if(Math.abs(rangeexp) > 3) {

0 commit comments

Comments
 (0)