Skip to content

Commit

Permalink
chore(charts): update chart's tooltip example (#9613)
Browse files Browse the repository at this point in the history
  • Loading branch information
dlabrecq authored Sep 13, 2023
1 parent dc65307 commit e0b0089
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -616,13 +616,13 @@ class TooltipPieChart extends React.Component {
super(props);

// Custom legend label component
// Note: Tooltip wraps children with a div tag, so we add a reference to ChartLabel instead
// Note: Tooltip wraps children with a div tag, so we use a reference to ChartLabel instead
this.LegendLabel = ({datum, ...rest}) => {
const ref = React.createRef();
return (
<g ref={ref}>
<ChartLabel {...rest} />
<Tooltip content={datum.name} enableFlip reference={ref} />
<Tooltip content={datum.name} enableFlip triggerRef={ref} />
</g>
);
}
Expand Down

0 comments on commit e0b0089

Please sign in to comment.