File tree 2 files changed +10
-3
lines changed
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) {
868
868
if ( p !== undefined ) {
869
869
t . periodX = p ;
870
870
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
+
871
874
t . text = ' ' ; // don't use an empty string here which can confuse automargin (issue 5132)
872
875
ax . _prevDateHead = '' ;
873
876
}
Original file line number Diff line number Diff line change @@ -5267,10 +5267,14 @@ describe('Test axes', function() {
5267
5267
var ax = gd . _fullLayout . xaxis ;
5268
5268
5269
5269
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
-
5272
5270
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
+ }
5274
5278
}
5275
5279
5276
5280
[ '%Y' , '%y' ] . forEach ( function ( formatter , i ) {
You can’t perform that action at this time.
0 commit comments