File tree 1 file changed +23
-5
lines changed
1 file changed +23
-5
lines changed Original file line number Diff line number Diff line change @@ -2974,17 +2974,35 @@ axes.makeTransTickLabelFn = function(ax) {
2974
2974
var u = uv [ 0 ] ;
2975
2975
var v = uv [ 1 ] ;
2976
2976
2977
- return ax . _id . charAt ( 0 ) === 'x' ?
2977
+ var isXaxis = ax . _id . charAt ( 0 ) === 'x' ;
2978
+ var isYaxis = ! isXaxis ;
2979
+ var isReversed = ax . range [ 0 ] > ax . range [ 1 ] ;
2980
+ var ticksInside = ax . ticklabelposition && ax . ticklabelposition . indexOf ( 'inside' ) !== - 1 ;
2981
+ var ticksOutside = ! ticksInside ;
2982
+
2983
+ if ( runoff ) {
2984
+ var runoffSign = isReversed ? - 1 : 1 ;
2985
+ runoff = runoff * runoffSign ;
2986
+ }
2987
+ if ( standoff ) {
2988
+ var standoffSign =
2989
+ isXaxis && ax . side === 'bottom' && ticksOutside ||
2990
+ isXaxis && ax . side === 'top' && ticksInside ||
2991
+ isYaxis && ax . side === 'right' && ticksOutside ||
2992
+ isYaxis && ax . side === 'left' && ticksInside ? 1 : - 1 ;
2993
+ standoff = standoff * standoffSign ;
2994
+ }
2995
+ return isXaxis ?
2978
2996
function ( d ) {
2979
2997
return strTranslate (
2980
- u + ax . _offset + ax . l2p ( getPosX ( d ) ) + standoff ,
2981
- v + runoff
2998
+ u + ax . _offset + ax . l2p ( getPosX ( d ) ) + runoff ,
2999
+ v + standoff
2982
3000
) ;
2983
3001
} :
2984
3002
function ( d ) {
2985
3003
return strTranslate (
2986
- v + runoff ,
2987
- u + ax . _offset + ax . l2p ( getPosX ( d ) ) + standoff
3004
+ v + standoff ,
3005
+ u + ax . _offset + ax . l2p ( getPosX ( d ) ) + runoff
2988
3006
) ;
2989
3007
} ;
2990
3008
} ;
You can’t perform that action at this time.
0 commit comments