@@ -46,9 +46,6 @@ type ChartXAxisLabelsProps = {
4646
4747 /** Y-pixel coordinate of the bottom edge of the chart plot area. */
4848 chartBoundsBottom : number ;
49-
50- /** When true, rotated labels are centered on the tick. When false, they are right-aligned (end of text at tick). */
51- centerRotatedLabels ?: boolean ;
5249} ;
5350
5451function ChartXAxisLabels ( {
@@ -65,7 +62,6 @@ function ChartXAxisLabels({
6562 labelColor,
6663 xScale,
6764 chartBoundsBottom,
68- centerRotatedLabels = false ,
6965} : ChartXAxisLabelsProps ) {
7066 const angleRad = ( Math . abs ( labelRotation ) * Math . PI ) / 180 ;
7167 const truncatedLabels = ( ( ) => {
@@ -89,8 +85,7 @@ function ChartXAxisLabels({
8985 const { ascent, descent} = getFontLineMetrics ( fontMgr , fontSize ) ;
9086
9187 const correction = rotatedLabelCenterCorrection ( ascent , descent , angleRad ) ;
92- const centeredUpwardOffset = centerRotatedLabels && angleRad > 0 ? ( Math . max ( ...renderedWidths ) / 2 ) * Math . sin ( angleRad ) : 0 ;
93- const labelY = chartBoundsBottom + AXIS_LABEL_GAP + rotatedLabelYOffset ( ascent , descent , angleRad ) + centeredUpwardOffset ;
88+ const labelY = chartBoundsBottom + AXIS_LABEL_GAP + rotatedLabelYOffset ( ascent , descent , angleRad ) ;
9489
9590 return truncatedLabels . map ( ( label , i ) => {
9691 if ( i % labelSkipInterval !== 0 || label . length === 0 ) {
@@ -117,7 +112,7 @@ function ChartXAxisLabels({
117112 ) ;
118113 }
119114
120- const textX = centerRotatedLabels ? tickX - renderWidth / 2 : tickX - renderWidth ;
115+ const textX = tickX - renderWidth ;
121116 const origin = vec ( tickX , labelY ) ;
122117
123118 return (
0 commit comments