antvis/G2

Do you want to work on this issue?

You can request for a bounty in order to promote it!

如何实现类似g2plot,柱状图hover元素区域外的同时,也高亮背景色? #6389

dskin posted onGitHub

问题描述

在g2plot中,柱状图hover的默认行为是不管hover到元素内还是元素外,该列数据的背景色都会被显示出来; 在g2中,柱状图只在hover中元素时显示该列背景色,在元素之外则不会显示; 若要实现该效果,该如何进行配置呢?

重现链接

No response

重现步骤

No response

预期行为

No response

平台

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

屏幕截图或视频(可选)

g2plot g2v5

补充说明(可选)

No response


新版本中暂时不支持。

posted by hustcc 8 months ago

我来实现下

posted by Runtus 8 months ago

@hustcc 大佬,想问下,这快逻辑的代码写在哪里比较合适呢?我自己感觉是放到interaction下比较合适,但是不知道放到tooltip中合不合适

posted by Runtus 8 months ago

@Runtus 忘了回复不好意思,肯定是放 interaction 最好的。elementHighlight 中。

posted by hustcc 19 days ago

好的,get了。哈哈哈抱歉,大佬你今天回我我也想起来,上学期我中途去做学校项目了,然后一直忙毕设最近才忙完。我这段时间给他实现一下。 @hustcc

posted by Runtus 18 days ago
posted by hustcc 18 days ago

我重新看了下用户的需求,是想要hover在元素外也能高亮相同x轴范围下的元素?目前g2的实现是hover在元素上才能高亮

posted by Runtus 18 days ago

@Runtus 了解了,可以参考:https://github.com/antvis/G2/pull/6724

posted by hustcc 18 days ago

Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests