Skip to content

Commit a0fdcfb

Browse files
committed
fix tooltip position for group mode
1 parent e605418 commit a0fdcfb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/core/components/core-tooltip.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@ export function ChartTooltip({
6060
if (!tooltip.visible || tooltip.group.length === 0) {
6161
return null;
6262
}
63+
const chart = tooltip.group[0]?.series.chart;
6364
const renderers = getTooltipContentOverrides?.({ point: tooltip.point, group: tooltip.group });
6465
const getTrack = placement === "target" ? api.getTargetTrack : api.getGroupTrack;
65-
const orientation = tooltip.point?.series.chart.inverted ? "horizontal" : "vertical";
6666
const position = (() => {
6767
if (placement === "target" || placement === "middle") {
68-
return orientation === "vertical" ? "right" : "bottom";
68+
return !chart.inverted ? "right" : "bottom";
6969
} else {
70-
return orientation === "vertical" ? "bottom" : "right";
70+
return !chart.inverted ? "bottom" : "right";
7171
}
7272
})();
7373
const content = getTooltipContent(api, {

0 commit comments

Comments
 (0)