echarts - event 3.1.6

ukris picture ukris · Apr 20, 2016 · Viewed 11.1k times · Source

This is in reference to echars from Baidu (version 3.1.6)

How do I control two charts based on click event on one of them. In other words - how do I intercept the click event.

Thanks in advance

Answer

SG_ picture SG_ · May 23, 2016

You can use all events listed in the echarts api documentation. An example of click event could be

chartOne.on('click', function (params) {
   console.log(params); // do whatever you want with another chart say chartTwo here
   alert( "chartOne clicked" );
});

where chartOne is an echarts instance. You can use any of the methods listed here to change second chart/chart-instance from click(or any) event on the first(chartOne).