File tree Expand file tree Collapse file tree 1 file changed +23
-5
lines changed Expand file tree Collapse file tree 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) {
29742974 var u = uv [ 0 ] ;
29752975 var v = uv [ 1 ] ;
29762976
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 ?
29782996 function ( d ) {
29792997 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
29823000 ) ;
29833001 } :
29843002 function ( d ) {
29853003 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
29883006 ) ;
29893007 } ;
29903008} ;
You can’t perform that action at this time.
0 commit comments