antvis/G2

tooltip 展示信息不完整 #5906

Song-yi-Tao posted onGitHub

问题描述

绘制两条线图,其中一条数据不完整,在不完整数据的最后一个点 hover 时,鼠标放置于 crosshairs 右侧时 tooltip 展示信息不完全。

重现链接

https://codesandbox.io/s/unruffled-sammet-f49xwl?file=/index.ts

重现步骤

No response

预期行为

No response

平台

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

屏幕截图或视频(可选)

<img width="720" alt="image" src="https://github.com/antvis/G2/assets/58683056/ab9aa8b8-ec5a-4306-b8df-c739ad25ac3f">

补充说明(可选)

No response


这个其实是复合预期的,因为鼠标在该条直线范围的之外了,就不会拾取到对应的数据。

posted by pearmini over 1 year ago

这个其实是复合预期的,因为鼠标在该条直线范围的之外了,就不会拾取到对应的数据。

但是鼠标放在左侧 tooltip 是可以显示完整信息的

posted by Song-yi-Tao over 1 year ago

@Song-yi-Tao 因为在左侧的时候鼠标是在该条直线范围之内?

posted by pearmini over 1 year ago

@Song-yi-Tao 因为在左侧的时候鼠标是在该条直线范围之内?

在连续的数据范围内,鼠标在 crosshairs 左右两侧一定范围内都可正常显示 tooltip 信息,而在数据有缺的最后一个数据点,鼠标放在 crosshairs 右侧就不能展示全量 tooltip 信息

posted by Song-yi-Tao over 1 year ago

@Song-yi-Tao 是的,当让如果只有一条线是没有这个问题的,因为移除这条线就没有 crosshairs 了。只有当多条线,且这些的开始和结束点不同的时候才会出现这个问题。

posted by pearmini over 1 year ago

Fund this Issue

$0.00
Funded

Pull requests