Sunburst series click event sends the wrong data when coming back from multi level drilled down state
Version
5.0.2
Steps to reproduce
Drill down to multiple levels while listing to series click event .
myChart.on('click', 'series', (e)=>{ console.log(e.data)})
event always contains the 1st level data when coming back after a drill down state.
What is expected?
correct data for current level should be sent along with the click event
What is actually happening?
chart always sends the 1st level data when coming back
please refer the attached video.

Hi! We've received your issue and please be patient to get responded. 🎉 The average response time is expected to be within one day for weekdays.
In the meanwhile, please make sure that you have posted enough image to demo your request. You may also check out the API and chart option to get the answer.
If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to [email protected]. Please attach the issue link if it's a technical question.
If you are interested in the project, you may also subscribe our mailing list.
Have a nice day! 🍵
Anyone got this solved?
Technically i think it's the correct functionality- the center of a sunburst chart is always considered the "root" so it should always show the root or the top level of the data hierarchy.
I was also facing the same problem so I clicked around the browser inspector of the echarts object and I think I found a solution, which is to get the chart model's series viewRoot:
let viewRoot = myChart._model.getSeries()[0]._viewRoot; console.log(viewRoot);
of interest are these properties: name (name of current node), depth (depth of tree; 0=root, 1=1st level, etc.), children[] (array of data objects under current level).
so within the click handler you can do:
myChart.on('click', 'series', (e)=>
{
console.log(e.data);
let viewRoot = myChart._model.getSeries()[0]._viewRoot;
switch(viewRoot.depth)
{
case 0: /*do something for root*/ break;
case 1: /*do something for 1st level*/ break;
..etc..
}
});
if you need to get the chart object at some other point in the code:
echarts.getInstanceByDom(document.getElementById("your chart element id"))._model.getSeries()[0]._viewRoot
I've only just discovered this charting library last week so am quite new and still exploring it too.
This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.
This issue has been automatically closed because it did not have recent activity. If this remains to be a problem with the latest version of Apache ECharts, please open a new issue and link this to it. Thanks!