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

如何connect 两个chart? #7

Open
xiatianshitiancai opened this issue Sep 21, 2022 · 3 comments
Open

如何connect 两个chart? #7

xiatianshitiancai opened this issue Sep 21, 2022 · 3 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@xiatianshitiancai
Copy link

No description provided.

@lloydzhou
Copy link
Owner

@xiatianshitiancai
刚刚参照connect的文档写了一个connect的demo
点击Legend或者tooltip的时候,上下两个图是可以联动的。

https://codesandbox.io/s/vuecharts3-connect-demo-vigks2

image

@lloydzhou lloydzhou self-assigned this Sep 21, 2022
@lloydzhou lloydzhou added the help wanted Extra attention is needed label Sep 21, 2022
@lloydzhou
Copy link
Owner

lloydzhou commented Sep 21, 2022

其实有好几种不同的实现思路:

  1. Chart 组件支持一个 finished事件,可以在这个事件里面调用connect('group1')
  2. 可以像上面的demo一样在一个子组件里面通过inject拿到chart对象,再通过chart对象调用api

@xiatianshitiancai
Copy link
Author

明白了。谢谢🙏。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants