@@ -2658,7 +2658,7 @@ axes.makeLabelFns = function(ax, shift, angle) {
2658
2658
out . xFn = function ( d ) { return d . dx + x0 ; } ;
2659
2659
out . yFn = function ( d ) { return d . dy + y0 + d . fontSize * ff ; } ;
2660
2660
out . anchorFn = function ( d , a ) {
2661
- if ( insideTickLabels || isAligned ) {
2661
+ if ( isAligned ) {
2662
2662
if ( isLeft ) return 'end' ;
2663
2663
if ( isRight ) return 'start' ;
2664
2664
}
@@ -2684,19 +2684,30 @@ axes.makeLabelFns = function(ax, shift, angle) {
2684
2684
2685
2685
x0 = labelStandoff ;
2686
2686
y0 = labelShift * flipIt ;
2687
+ var tickangle = ax . tickangle ;
2687
2688
ff = 0 ;
2688
- if ( Math . abs ( ax . tickangle ) === 90 ) {
2689
+ if ( Math . abs ( tickangle ) === 90 ) {
2689
2690
if (
2690
- ( ax . tickangle === - 90 && side === 'left' ) ||
2691
- ( ax . tickangle === 90 && side === 'right' )
2691
+ ( tickangle === - 90 && side === 'left' ) ||
2692
+ ( tickangle === 90 && side === 'right' )
2692
2693
) {
2693
2694
ff = CAP_SHIFT ;
2694
2695
} else {
2695
2696
ff = 0.5 ;
2696
2697
}
2697
2698
}
2698
2699
2699
- out . xFn = function ( d ) { return d . dx + shift - ( x0 + d . fontSize * ff ) * flipIt ; } ;
2700
+ var xQ = 0 ;
2701
+ if ( insideTickLabels ) {
2702
+ var ang = isNumeric ( tickangle ) ? + tickangle : 0 ;
2703
+ if ( ang !== 0 ) {
2704
+ var rA = Lib . deg2rad ( ang ) ;
2705
+ xQ = Math . abs ( Math . sin ( rA ) ) * CAP_SHIFT * flipIt ;
2706
+ ff = 0 ;
2707
+ }
2708
+ }
2709
+
2710
+ out . xFn = function ( d ) { return d . dx + shift - ( x0 + d . fontSize * ff ) * flipIt + xQ * d . fontSize ; } ;
2700
2711
out . yFn = function ( d ) { return d . dy + y0 + d . fontSize * MID_SHIFT ; } ;
2701
2712
out . anchorFn = function ( d , a ) {
2702
2713
if ( isNumeric ( a ) && Math . abs ( a ) === 90 ) {
@@ -2706,7 +2717,8 @@ axes.makeLabelFns = function(ax, shift, angle) {
2706
2717
return endSide ? 'end' : 'start' ;
2707
2718
} ;
2708
2719
out . heightFn = function ( d , a , h ) {
2709
- a *= ax . side === 'left' ? 1 : - 1 ;
2720
+ if ( ax . side === 'right' ) a *= - 1 ;
2721
+
2710
2722
return a < - 30 ? - h :
2711
2723
a < 30 ? - 0.5 * h :
2712
2724
0 ;
0 commit comments