antvis / antvis/G2

5.x使用了SVGRenderer,外部容器设置scale缩放时,tooltip位置和大小显示异常

Open
#6,559 3 comments 0 reactions 0 assignees View on GitHub
waiting for maintainer
Dominant language
TypeScript
Stars
12.6k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

### 问题描述

5.x使用了SVGRenderer,外部容器设置scale缩放时,tooltip位置和大小显示异常

```typescript
export function newChart(
container: string | HTMLElement,
options?: RuntimeOptions
): Chart {
const renderer = new SVGRenderer();
const chart = new Chart({
container,
autoFit: true,
theme: 'classicDark',
renderer,
...options,
});
return chart;
}
```

![image](https://github.com/user-attachments/assets/3b6b6492-1a17-4616-9248-7902280b791e)

### 重现链接

https://codesandbox.io/p/devbox/kl2rv9

### 重现步骤

1、进入页面 2、将鼠标移动到柱体上,查看错误

### 预期行为

tooltip展示大小和位置正常

### 平台

- 操作系统: [macOS, Windows, Linux, React Native ...]
- 网页浏览器: [Google Chrome, Safari, Firefox]

### 屏幕截图或视频(可选)

_No response_

### 补充说明(可选)

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the CodeSandbox reproduction and the newChart entry point, focusing on SVGRenderer and Chart tooltip behavior when the outer container uses scale. Compare the tooltip's position and size with the unscaled case; done means both remain correct under the reported scale.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.