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

图例超长情况下,修改图表高度(Resize),图例 tooltip 位置有误 #5409

Closed
Darsoon opened this issue Aug 16, 2023 · 3 comments · Fixed by #5436
Closed

Comments

@Darsoon
Copy link

Darsoon commented Aug 16, 2023

  • G2 Version: 4.1.32 5.x
  • Platform:
  • Mini Showcase(like screenshots):
  • CodePen Link:

当图例超长,然后修改图表高度,图例 tooltip 出现的位置有误
官方 demo 可复现

官网demo

@hustcc
Copy link
Member

hustcc commented Aug 16, 2023

@Darsoon 很好的问题,有兴趣来提交一个 PR 吗,这段代码在 https://github.com/antvis/G2/blob/master/src/interaction/action/component/tooltip/ellipsis-text.ts

问题就是 tooltip.show 之前,没有给正确的 curLoc。

@Darsoon
Copy link
Author

Darsoon commented Aug 17, 2023

@Darsoon 很好的问题,有兴趣来提交一个 PR 吗,这段代码在 https://github.com/antvis/G2/blob/master/src/interaction/action/component/tooltip/ellipsis-text.ts

问题就是 tooltip.show 之前,没有给正确的 curLoc。

👌🏻

@Darsoon
Copy link
Author

Darsoon commented Aug 20, 2023

@Darsoon 很好的问题,有兴趣来提交一个 PR 吗,这段代码在 https://github.com/antvis/G2/blob/master/src/interaction/action/component/tooltip/ellipsis-text.ts

问题就是 tooltip.show 之前,没有给正确的 curLoc。

问题排查不是因为没有给 curLoc,而是 tooltip 显示位置依赖 htmlTooltip 中的 region 属性,代码在 https://github.com/antvis/component/blob/master/src/util/align.ts#L72。
但目前 region 只在实例化时有赋值,后续图表发生 size 变更是没有更新该属性的。
所以修改方式是在触发 tooltip 时重新赋值 region

@Darsoon Darsoon closed this as completed Aug 30, 2023
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

Successfully merging a pull request may close this issue.

2 participants