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

legend 交互默认选中的问题 #2419

Closed
iiicon opened this issue May 7, 2020 · 4 comments
Closed

legend 交互默认选中的问题 #2419

iiicon opened this issue May 7, 2020 · 4 comments

Comments

@iiicon
Copy link

iiicon commented May 7, 2020

  • G2 Version: 4.0.7

  • Platform: pc

  • Mini Showcase(like screenshots):
    image

  • CodePen Link:

@iiicon
Copy link
Author

iiicon commented May 7, 2020

没有交互的时候 会偶尔会选中 偶现的情况

@Aiyanahy
Copy link

Aiyanahy commented Jan 4, 2021

解决了吗?我好像也遇到了类似的问题。这个不是偶现,鼠标悬浮在某个legend上直接滑动鼠标就会复现

@hustcc hustcc added the Legend label Jan 19, 2021
@hustcc
Copy link
Member

hustcc commented Jan 19, 2021

有复现的 demo 吗?

@hustcc hustcc added the Bug label Jan 19, 2021
@visiky
Copy link
Member

visiky commented Mar 28, 2021

解决了吗?我好像也遇到了类似的问题。这个不是偶现,鼠标悬浮在某个legend上直接滑动鼠标就会复现

移除图例某个交互就行,内置下面的交互,会导致 图例 item hover 时候,触发元素选中 element-acitve

// legend hover,element active
registerInteraction('legend-active', {
  start: [{ trigger: 'legend-item:mouseenter', action: ['list-active:active', 'element-active:active'] }],
  end: [{ trigger: 'legend-item:mouseleave', action: ['list-active:reset', 'element-active:reset'] }],
});

可以通过下面的方式,在全局覆盖内置的交互行为,移除 图例 hover,激活元素

registerInteraction('legend-active', {
  start: [{ trigger: 'legend-item:mouseenter', action: ['list-active:active'] }],
});

// 或者直接移除这个交互
chart.removerInteraction('legend-active')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants