Skip to content

Commit f5700e9

Browse files
committed
Refactor logic for skipLabel flag in combination with ticklabelindex
Previously, skipLabel was only valid for hiding ticks if ticklabelIndex wasn't set. Now, ticklabelIndex simply sets skipLabel correctly.
1 parent 60b5d66 commit f5700e9

1 file changed

Lines changed: 5 additions & 8 deletions

File tree

src/plots/cartesian/axes.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,6 +1174,9 @@ axes.calcTicks = function calcTicks(ax, opts) {
11741174
}
11751175
});
11761176
});
1177+
tickVals.forEach(function(tick) {
1178+
tick.skipLabel = allTicklabelVals.indexOf(tick) === -1;
1179+
});
11771180
}
11781181

11791182
if(hasMinor) {
@@ -1303,14 +1306,8 @@ axes.calcTicks = function calcTicks(ax, opts) {
13031306
} else {
13041307
lastVisibleHead = ax._prevDateHead;
13051308
t = setTickLabel(ax, tickVals[i]);
1306-
if (ticklabelIndex) {
1307-
if (allTicklabelVals.indexOf(tickVals[i]) === -1) {
1308-
hideLabel(t);
1309-
}
1310-
} else {
1311-
if (tickVals[i].skipLabel) {
1312-
hideLabel(t);
1313-
}
1309+
if (tickVals[i].skipLabel) {
1310+
hideLabel(t);
13141311
}
13151312

13161313
ticksOut.push(t);

0 commit comments

Comments
 (0)