antvis/G2

手动控制tooltip:show显示错误 #5912

200-tonnage-boy posted onGitHub

问题描述

对数据比较密集的折线图,使用chat.emit('tooltip:show')控制tooltip显示,tooltip显示的值与代码中触发tooltip:show的数据不一致;

重现链接

https://codesandbox.io/p/sandbox/youthful-monad-963crv

重现步骤

No response

预期行为

No response

平台

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

屏幕截图或视频(可选)

<img width="1108" alt="image" src="https://github.com/antvis/G2/assets/40828298/f3a874d4-b39f-42ee-91f5-fbd78678319d">

补充说明(可选)

  1. 相同数据下,线图数据点密集(or 容器宽度小)时容易复现,宽度拉宽后问题有一定缓解

可能和拾取有关系,可以作为一个中级任务。

posted by pearmini over 1 year ago

src/interaction/tooltip.ts:714 image

获取定位的方法调整下,因为showTooltip的bounding定位也是用的这个方法 image

posted by HuangLiangchen over 1 year ago

Fund this Issue

$0.00
Funded

Pull requests