@@ -2972,11 +2972,13 @@ function calcLabelLevelBbox(ax, cls, mainLinePositionShift) {
2972
2972
// (like in fixLabelOverlaps) instead and use Axes.getPxPosition
2973
2973
// together with the makeLabelFns outputs and `tickangle`
2974
2974
// to compute one bbox per (tick value x tick style)
2975
- var bb = Drawing . bBox ( thisLabel . node ( ) . parentNode ) ;
2976
- top = Math . min ( top , bb . top ) ;
2977
- bottom = Math . max ( bottom , bb . bottom ) ;
2978
- left = Math . min ( left , bb . left ) ;
2979
- right = Math . max ( right , bb . right ) ;
2975
+ if ( thisLabel . node ( ) . style . display !== 'none' ) {
2976
+ var bb = Drawing . bBox ( thisLabel . node ( ) . parentNode ) ;
2977
+ top = Math . min ( top , bb . top ) ;
2978
+ bottom = Math . max ( bottom , bb . bottom ) ;
2979
+ left = Math . min ( left , bb . left ) ;
2980
+ right = Math . max ( right , bb . right ) ;
2981
+ }
2980
2982
} ) ;
2981
2983
} else {
2982
2984
var dummyCalc = axes . makeLabelFns ( ax , mainLinePositionShift ) ;
@@ -3669,7 +3671,7 @@ axes.drawLabels = function(gd, ax, opts) {
3669
3671
'text-anchor' : anchor
3670
3672
} ) ;
3671
3673
3672
- thisText . style ( 'opacity ' , 1 ) ; // visible
3674
+ thisText . style ( 'display ' , null ) ; // visible
3673
3675
3674
3676
if ( ax . _adjustTickLabelsOverflow ) {
3675
3677
ax . _adjustTickLabelsOverflow ( ) ;
@@ -3727,9 +3729,9 @@ axes.drawLabels = function(gd, ax, opts) {
3727
3729
3728
3730
var t = thisLabel . select ( 'text' ) ;
3729
3731
if ( adjust ) {
3730
- if ( hideOverflow ) t . style ( 'opacity ' , 0 ) ; // hidden
3731
- } else {
3732
- t . style ( 'opacity ' , 1 ) ; // visible
3732
+ if ( hideOverflow ) t . style ( 'display ' , 'none' ) ; // hidden
3733
+ } else if ( t . node ( ) . style . display !== 'none' ) {
3734
+ t . style ( 'display ' , null ) ;
3733
3735
3734
3736
if ( side === 'bottom' || side === 'right' ) {
3735
3737
visibleLabelMin = Math . min ( visibleLabelMin , isX ? bb . top : bb . left ) ;
@@ -3806,7 +3808,7 @@ axes.drawLabels = function(gd, ax, opts) {
3806
3808
q > ax [ '_visibleLabelMin_' + anchorAx . _id ]
3807
3809
) {
3808
3810
t . style ( 'display' , 'none' ) ; // hidden
3809
- } else if ( e . K === 'tick' && ! idx ) {
3811
+ } else if ( e . K === 'tick' && ! idx && t . node ( ) . style . display !== 'none' ) {
3810
3812
t . style ( 'display' , null ) ; // visible
3811
3813
}
3812
3814
} ) ;
0 commit comments