Skip to content

Commit 2920e31

Browse files
committed
ensure new label positions remains between ticks
1 parent 50a3451 commit 2920e31

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/plots/cartesian/axes.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,9 @@ axes.calcTicks = function calcTicks(ax, opts) {
831831
periodLength *= 1 - nOut / nAll;
832832
}
833833

834-
v += periodLength / 2;
834+
if(periodLength <= actualDelta) { // i.e. to ensure new label positions remain between ticks
835+
v += periodLength / 2;
836+
}
835837

836838
ticksOut[i].periodX = v;
837839

0 commit comments

Comments
 (0)