File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1078,7 +1078,9 @@ axes.calcTicks = function calcTicks(ax, opts) {
10781078
10791079 if ( ( major || ticklabelIndex ) && isPeriod ) {
10801080 // if major: add one item to label period before tick0
1081- // if minor: add one item for ticklabelindex positioning
1081+ // if minor: add one item for ticklabelindex positioning. positionPeriodTicks requires
1082+ // at least 2 ticks to calculate the period length, so we add a dummy tick, ensuring
1083+ // that if a tick is labeled, there are always at least 2 ticks.
10821084 x = axes . tickIncrement ( x , dtick , ! axrev , calendar ) ;
10831085 if ( major ) majorId -- ;
10841086 }
@@ -1128,7 +1130,9 @@ axes.calcTicks = function calcTicks(ax, opts) {
11281130 }
11291131 }
11301132
1131- // check if ticklabelIndex makes sense, otherwise ignore it
1133+ // check if ticklabelIndex makes sense, otherwise ignore it.
1134+ // It makes sense if in addition to the always present dummy, there are at least 2 minor ticks
1135+ // with the required distance to each other.
11321136 if ( ! minorTickVals || minorTickVals . length < 3 ) {
11331137 ticklabelIndex = false ;
11341138 } else {
You can’t perform that action at this time.
0 commit comments