@@ -453,11 +453,13 @@ const useColumnsStackedState = (
453453
454454 const isMobile = useIsMobile ( ) ;
455455
456- const maybeFormatDate = useCallback (
456+ const formatXAxisTick = useCallback (
457457 ( tick : string ) => {
458- return isTemporalDimension ( xDimension ) ? formatXDate ( tick ) : tick ;
458+ return isTemporalDimension ( xDimension )
459+ ? formatXDate ( tick )
460+ : getXLabel ( tick ) ;
459461 } ,
460- [ xDimension , formatXDate ]
462+ [ xDimension , formatXDate , getXLabel ]
461463 ) ;
462464
463465 // Tooltips
@@ -499,7 +501,7 @@ const useColumnsStackedState = (
499501 xAnchor : xAnchorRaw + ( placement . x === "right" ? 0.5 : - 0.5 ) * bw ,
500502 yAnchor,
501503 placement,
502- value : maybeFormatDate ( xLabel ) ,
504+ value : formatXAxisTick ( xLabel ) ,
503505 datum : {
504506 label : fields . segment && getSegmentAbbreviationOrLabel ( datum ) ,
505507 value : yValueFormatter ( getY ( datum ) , getIdentityY ( datum ) ) ,
@@ -533,7 +535,7 @@ const useColumnsStackedState = (
533535 isMobile ,
534536 normalize ,
535537 yScale ,
536- maybeFormatDate ,
538+ formatXAxisTick ,
537539 ]
538540 ) ;
539541
@@ -563,7 +565,7 @@ const useColumnsStackedState = (
563565 leftAxisLabelOffsetTop : top ,
564566 bottomAxisLabelSize,
565567 valueLabelFormatter,
566- formatXAxisTick : maybeFormatDate ,
568+ formatXAxisTick : formatXAxisTick ,
567569 ...variables ,
568570 } ;
569571} ;
0 commit comments