Skip to content

Commit e93f51a

Browse files
authored
fix: Fixes pie chart tooltip placement in Firefox (#62)
* fix: Fixes pie chart tooltip placement in Firefox * Update chart-extra-tooltip.tsx
1 parent 00dbda8 commit e93f51a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/core/chart-api/chart-extra-tooltip.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,8 @@ function getPieChartTargetPlacement(point: Highcharts.Point): Rect {
198198
// Instead, there is a `tooltipPos` tuple, which is not covered by TS.
199199
// See: https://github.com/highcharts/highcharts/issues/23118.
200200
if ("tooltipPos" in point && Array.isArray(point.tooltipPos)) {
201-
return { x: point.tooltipPos[0], y: point.tooltipPos[1], width: 0, height: 0 };
201+
// We use very small but non-zero track size as otherwise it is placed incorrectly in Firefox.
202+
return { x: point.tooltipPos[0], y: point.tooltipPos[1], width: 0.1, height: 0.1 };
202203
}
203204
// We use the alternative, middle, tooltip placement as a fallback, in case the undocumented "tooltipPos"
204205
// is no longer available in the point.

0 commit comments

Comments
 (0)