Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Oct 6, 2022. It is now read-only.

Commit 8197ea0

Browse files
committed
Set default exponentbase for when called externally
1 parent e5830ef commit 8197ea0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/plots/cartesian/axes.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,8 @@ axes.autoBin = function(data,ax,nbins,is2d) {
373373
// piggyback off autotick code to make "nice" bin sizes
374374
var dummyax = {
375375
type: ax.type==='log' ? 'linear' : ax.type,
376-
range:[datamin, datamax]
376+
range:[datamin, datamax],
377+
exponentbase: ax.exponentbase
377378
};
378379
axes.autoTicks(dummyax, size0);
379380
var binstart = axes.tickIncrement(
@@ -651,7 +652,7 @@ axes.autoTicks = function(ax, roughDTick){
651652
else{
652653
// auto ticks always start at 0 and increment
653654
ax.tick0 = 0;
654-
base = Math.pow(ax.exponentbase, Math.floor(Math.log(roughDTick) / Math.log(ax.exponentbase)));
655+
base = Math.pow(exponentbase, Math.floor(Math.log(roughDTick) / Math.log(exponentbase)));
655656
ax.dtick = roundDTick(roughDTick, base, roundBase10);
656657
}
657658

0 commit comments

Comments
 (0)