antvis/G2

tooltip position 希望支持 bottomRight bottomRight topRight topLeft 选项 #3950

Dawnwangzi posted onGitHub

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

What problem does this feature solve?

当有一个较大的tooltip时,我们希望可以控制tooltip的方向为bottomRight,而不是单纯的bottom。单纯的bottom tooltip在鼠标位置在整个tooltip的上方中间位置,看起来很奇怪。而right或left会遮挡图表。

What does the proposed API look like?

tooltip position 希望支持 bottomRight bottomRight topRight topLeft 选项

<!-- generated by antv-issue-helper. DO NOT REMOVE -->


这个本质不是 tooltip 位置的问题,而是 tooltip 渲染在图表容器内,所以无法超出这个空间,导致遮挡图表。这个在 4.x 是无法解决的,这个问题在 5.0 中解决了。https://g2.antv.antgroup.com/spec/interaction/tooltip

.interaction('tooltip', {
  mount: document.body
})

tooltip 渲染到 body 中,就大大扩大了 tooltip 的空间。

posted by hustcc over 1 year ago

Fund this Issue

$0.00
Funded

Pull requests