@@ -545,14 +545,15 @@ const CATEGORY_LABEL_LINE_EM = 1.1;
545545 * characters, which left a bar named only by its first letters ("In Progr…").
546546 */
547547function WrappedCategoryTick ( props : any ) {
548- const { x, y, payload, textAnchor, maxWidthPx, formatLabel } = props ;
548+ const { x, y, payload, textAnchor, orientation , maxWidthPx, formatLabel } = props ;
549549 const full = String ( formatLabel ( payload ?. value ) ?? '' ) ;
550550 const { lines, truncated } = wrapCategoryLabel ( full , maxWidthPx ) ;
551551 // Centre the block on the tick: the first line rises half the extra lines,
552552 // and 0.355em puts a line's middle (not its baseline) on `y`.
553553 const firstDy = `${ 0.355 - ( ( lines . length - 1 ) * CATEGORY_LABEL_LINE_EM ) / 2 } em` ;
554554 return (
555- < text x = { x } y = { y } textAnchor = { textAnchor ?? 'end' } fill = { AXIS_TICK_STYLE . fill } className = "recharts-text recharts-cartesian-axis-tick-value" >
555+ // `orientation` as recharts' own tick text carries it: the side the axis is drawn on.
556+ < text x = { x } y = { y } textAnchor = { textAnchor ?? 'end' } fill = { AXIS_TICK_STYLE . fill } orientation = { orientation } className = "recharts-text recharts-cartesian-axis-tick-value" >
556557 { truncated ? < title > { full } </ title > : null }
557558 { lines . map ( ( line , i ) => (
558559 < tspan key = { i } x = { x } dy = { i === 0 ? firstDy : `${ CATEGORY_LABEL_LINE_EM } em` } > { line } </ tspan >
@@ -621,8 +622,8 @@ const DATA_LABEL_CHART_MARGIN = {
621622 *
622623 * ## Why this size
623624 *
624- * Half of a `YYYY-MM` label, the bucket a monthly trend chart draws, at the
625- * tick font, by the same upper estimate the rotated band is sized from
625+ * Half of a month bucket's label (`Oct 2026` , the face a `YYYY-MM` key draws,
626+ * objectstack#27520), the bucket a monthly trend chart draws, at the tick font, by the same upper estimate the rotated band is sized from
626627 * ({@link estimateLabelWidthPx}), less the chart margin already on that side.
627628 * A fixed figure, not one sized from each chart's labels, so every line and
628629 * area chart lays out the same way. It is not a bound on every label: a long
@@ -633,7 +634,7 @@ const DATA_LABEL_CHART_MARGIN = {
633634 * derived from recharts' layout, not measured in a browser.
634635 */
635636const POINT_X_AXIS_EDGE_PADDING_PX =
636- Math . ceil ( estimateLabelWidthPx ( '0000-00 ' ) / 2 ) - CHART_MARGIN_X_PX / 2 ;
637+ Math . ceil ( estimateLabelWidthPx ( 'Mmm 0000' ) / 2 ) - CHART_MARGIN_X_PX / 2 ;
637638/** A module constant so recharts' axis settings memo is not defeated per render. */
638639const POINT_X_AXIS_PADDING = {
639640 left : POINT_X_AXIS_EDGE_PADDING_PX ,
0 commit comments