-
Notifications
You must be signed in to change notification settings - Fork 620
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
How to connect several charts? #9
Comments
Hello, here is the demo code: The <ReactEcharts ref='echarts_react_1'
option={this.getOption_1()} />
<ReactEcharts ref='echarts_react_2'
option={this.getOption_2()} /> Then use react // this is the origin echarts instance, can use all API [here](http://echarts.baidu.com/api.html#echartsInstance).
let echarts_instance_1 = this.refs.echarts_react_1.getEchartsInstance();
let echarts_instance_2 = this.refs.echarts_react_2.getEchartsInstance();
// connect charts
echarts_instance_1.connect([echarts_instance_2 , ...]); Can help you ? |
Well, it doesn't work. I figured out that I can make something like htis:
But it also doesn't work as I expect. When I have one chart, it does nothing. That's ok. When another one is added via data change, they become linked and work as expected. But then, when I call |
Sorry, my mistake. let echarts_instance_1 = this.refs.echarts_react_1.getEchartsInstance();
let echarts_instance_2 = this.refs.echarts_react_2.getEchartsInstance();
echarts_instance_1.group = 'group1';
echarts_instance_2.group = 'group1';
// the echarts instance should require from echarts: import echarts from 'echarts';
echarts.connect('group1');
// or connect the charts array like this
// echarts.connect([chart1, chart2]); The demo of |
Yep, it works one time, either way works. But if I create one more chart afterwards and trying to connect it to existing group, it fails. |
Additional, the api In fact, I never used the api If you hava done it, welcome to pull a request. ^_^~ |
You can just try The document has no demo which connect charts Dynamic. |
Thanks! I'll try to use disConnect |
If can work, give me callback. ^_^~ |
and then
so it doesn't help... |
I have found the problem!
Thanks! |
Great! |
大家好.
I'm trying to build a system with several interconnected charts just like it's described there: https://ecomfe.github.io/echarts/doc/example/mix8.html#macarons2-en but using React wrapper.
How can I access echart instance and it's .connect method?
Thanks!
The text was updated successfully, but these errors were encountered: