Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

根据XY点 返回 xy轴上的值 #3449

Closed
1 task
ValueLan opened this issue May 31, 2021 · 1 comment
Closed
1 task

根据XY点 返回 xy轴上的值 #3449

ValueLan opened this issue May 31, 2021 · 1 comment

Comments

@ValueLan
Copy link

  • I have searched the issues of this repository and believe that this is not a duplicate.

What problem does this feature solve?

K线的时候 可以画出当前鼠标的值

What does the proposed API look like?

根据XY点 返回 xy轴上的值

@hustcc
Copy link
Member

hustcc commented Sep 30, 2021

  • 首先监听 mousemove 事件,获取鼠标的 x y 位置
  • 然后 x y 位置可以通过 coordinate 转化成归一化的坐标(0 ~ 1 范围)
  • 然后归一化的 x y 分别用 scaleX、scaleY 做 invert 操作,就可以拿到 x y 实际的值了

@hustcc hustcc closed this as completed Sep 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants