File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -630,12 +630,14 @@ axes.calcTicks = function calcTicks(ax, opts) {
630
630
generateTicks ( ) ;
631
631
632
632
var isPeriod = ax . ticklabelmode === 'period' ;
633
- if ( isPeriod ) {
633
+ var addedPreTick0Label = false ;
634
+ if ( isPeriod && tickVals [ 0 ] ) {
634
635
// add one label to show pre tick0 period
635
636
tickVals . unshift ( {
636
637
minor : false ,
637
638
value : axes . tickIncrement ( tickVals [ 0 ] . value , ax . dtick , ! axrev , ax . caldendar )
638
639
} ) ;
640
+ addedPreTick0Label = true ;
639
641
}
640
642
641
643
if ( ax . rangebreaks ) {
@@ -778,7 +780,7 @@ axes.calcTicks = function calcTicks(ax, opts) {
778
780
ticksOut . push ( t ) ;
779
781
}
780
782
781
- if ( isPeriod ) {
783
+ if ( isPeriod && addedPreTick0Label ) {
782
784
var removedPreTick0Label = false ;
783
785
784
786
for ( i = 0 ; i < ticksOut . length ; i ++ ) {
You can’t perform that action at this time.
0 commit comments