File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -868,6 +868,9 @@ axes.calcTicks = function calcTicks(ax, opts) {
868868 if ( p !== undefined ) {
869869 t . periodX = p ;
870870 if ( p > maxRange || p < minRange ) { // hide label if outside the range
871+ if ( p > maxRange ) t . periodX = maxRange ;
872+ if ( p < minRange ) t . periodX = minRange ;
873+
871874 t . text = ' ' ; // don't use an empty string here which can confuse automargin (issue 5132)
872875 ax . _prevDateHead = '' ;
873876 }
Original file line number Diff line number Diff line change @@ -5267,10 +5267,14 @@ describe('Test axes', function() {
52675267 var ax = gd . _fullLayout . xaxis ;
52685268
52695269 var positions = ax . _vals . map ( function ( d ) { return ax . c2d ( d . periodX !== undefined ? d . periodX : d . x ) ; } ) ;
5270- expect ( positions ) . withContext ( msg ) . toEqual ( expPositions ) ;
5271-
52725270 var labels = ax . _vals . map ( function ( d ) { return d . text ; } ) ;
5273- expect ( labels ) . withContext ( msg ) . toEqual ( expLabels ) ;
5271+
5272+ for ( var i = 0 ; i < labels . length ; i ++ ) {
5273+ expect ( labels [ i ] ) . withContext ( msg ) . toBe ( expLabels [ i ] ) ;
5274+ if ( labels [ i ] !== ' ' ) {
5275+ expect ( positions [ i ] ) . withContext ( msg ) . toBe ( expPositions [ i ] ) ;
5276+ }
5277+ }
52745278 }
52755279
52765280 [ '%Y' , '%y' ] . forEach ( function ( formatter , i ) {
You can’t perform that action at this time.
0 commit comments