@@ -2804,7 +2804,10 @@ axes.drawTicks = function(gd, ax, opts) {
2804
2804
. classed ( 'crisp' , opts . crisp !== false )
2805
2805
. call ( Color . stroke , ax . tickcolor )
2806
2806
. style ( 'stroke-width' , Drawing . crispRound ( gd , ax . tickwidth , 1 ) + 'px' )
2807
- . attr ( 'd' , opts . path ) ;
2807
+ . attr ( 'd' , opts . path )
2808
+ . style ( VISIBLE ) ;
2809
+
2810
+ hideCounterAxisInsideTickLabels ( ax ) ;
2808
2811
2809
2812
ticks . attr ( 'transform' , opts . transFn ) ;
2810
2813
} ;
@@ -3078,8 +3081,10 @@ axes.drawLabels = function(gd, ax, opts) {
3078
3081
if ( bb . bottom > max ) hide = true ;
3079
3082
else if ( bb . top + ( ax . tickangle ? 0 : d . fontSize / 4 ) < min ) hide = true ;
3080
3083
}
3084
+
3085
+ var t = thisLabel . select ( 'text' ) ;
3081
3086
if ( hide ) {
3082
- thisLabel . select ( 'text' ) . style ( HIDDEN ) ;
3087
+ t . style ( HIDDEN ) ;
3083
3088
} else {
3084
3089
visibleLabelMin = Math . min ( visibleLabelMin , isX ? bb . top : bb . left ) ;
3085
3090
visibleLabelMax = Math . max ( visibleLabelMax , isX ? bb . bottom : bb . right ) ;
@@ -3096,14 +3101,32 @@ axes.drawLabels = function(gd, ax, opts) {
3096
3101
3097
3102
ax . _hideCounterAxisInsideTickLabels = function ( ) {
3098
3103
if ( insideTicklabelposition ( ax . _anchorAxis || { } ) ) {
3099
- var grid = opts . plotinfo . gridlayer . select ( '.' + ax . _id ) ;
3100
- grid . each ( function ( ) {
3101
- d3 . select ( this ) . selectAll ( 'path' ) . each ( function ( d ) {
3102
- var q = ax . l2p ( d . x ) + ax . _offset ;
3103
-
3104
- if ( q < ax . _visibleLabelMax && q > ax . _visibleLabelMin ) {
3105
- d3 . select ( this ) . style ( HIDDEN ) ;
3106
- }
3104
+ [
3105
+ { K : 'gridline' , L : 'path' } ,
3106
+ { K : 'zeroline' , L : 'path' } ,
3107
+ { K : 'tick' , L : 'path' } ,
3108
+ { K : 'tick' , L : 'text' } ,
3109
+ { K : 'tick2' , L : 'text' } ,
3110
+ { K : 'tick2' , L : 'path' } ,
3111
+ { K : 'divider' , L : 'path' }
3112
+
3113
+ ] . forEach ( function ( e ) {
3114
+ var isX = ax . _id . charAt ( 0 ) === 'x' ;
3115
+
3116
+ var sel ;
3117
+ if ( e . K === 'gridline' ) sel = opts . plotinfo . gridlayer ;
3118
+ else if ( e . K === 'zeroline' ) sel = opts . plotinfo . zerolinelayer ;
3119
+ else sel = opts . plotinfo [ ( isX ? 'x' : 'y' ) + 'axislayer' ] ;
3120
+
3121
+ sel . each ( function ( ) {
3122
+ d3 . select ( this ) . selectAll ( e . L ) . each ( function ( d ) {
3123
+ var q = ax . l2p ( d . x ) + ax . _offset ;
3124
+
3125
+ var t = d3 . select ( this ) ;
3126
+ if ( q < ax . _visibleLabelMax && q > ax . _visibleLabelMin ) {
3127
+ t . style ( HIDDEN ) ;
3128
+ }
3129
+ } ) ;
3107
3130
} ) ;
3108
3131
} ) ;
3109
3132
}
0 commit comments