Skip to content

Commit 4a535fc

Browse files
committed
fixup auto minor when having major tickvals
1 parent fd312fd commit 4a535fc

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

src/plots/cartesian/axes.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -820,14 +820,19 @@ axes.calcTicks = function calcTicks(ax, opts) {
820820

821821
var mockAx = major ? ax : Lib.extendFlat({}, ax, ax.minor);
822822

823-
if(isMinor && ax.minor && !ax.minor.dtick) {
824-
mockAx._majorDtick = ax.dtick;
823+
if(isMinor && ax.minor) {
824+
if(!ax.minor.dtick) {
825+
mockAx._majorDtick = ax.dtick;
825826

826-
mockAx.dtick = mockAx._dtickInit;
827-
mockAx.tick0 = mockAx._tick0Init;
827+
mockAx.dtick = mockAx._dtickInit;
828+
mockAx.tick0 = mockAx._tick0Init;
829+
}
828830
}
829831

830-
axes.prepTicks(mockAx, opts, isMinor);
832+
axes.prepTicks(mockAx, opts,
833+
isMinor &&
834+
ax.tickmode !== 'array' // avoid dense grid when main axes has tickvals
835+
);
831836

832837
// now that we've figured out the auto values for formatting
833838
// in case we're missing some ticktext, we can break out for array ticks
@@ -839,7 +844,7 @@ axes.calcTicks = function calcTicks(ax, opts) {
839844
minorTickVals = [];
840845
minorTicks = arrayTicks(ax);
841846
}
842-
break;
847+
continue;
843848
}
844849

845850
// add a tiny bit so we get ticks which may have rounded out

0 commit comments

Comments
 (0)