Incubator-echarts: Legend filtering not working correctly with pie chart selection?

Created on 15 Nov 2019  ·  8Comments  ·  Source: apache/incubator-echarts

Version

4.4.0

Steps to reproduce

Use legend to filter out selected sector from pie chart - next sector becomes selected

What is expected?

Right behaviour would be that selected sector just to became hidden and next sector remained unselected.

What is actually happening?

When filtering out selected sector from pie chart, next sector becomes selected instead


If it is not a bug, can anyone tell me how to avoid this behaviour?


bug en pie

Most helpful comment

o, I see. You mean, after the previous selected item has been removed, the selected state would be applied to next slice.. It seems a bug ? @Ovilia .
I guess the selected state is bind to index of item in data array, not item ID, which cause this to happen.

All 8 comments

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 questions.

If you are interested in the project, you may also subscribe our mail list.

Have a nice day! 🍵

This is the behaviour right now:

image

image

@mariamtsartsidze Can you provide a demo? https://jsfiddle.net/ovilia/n6xc4df3/
I cannot reproduce from https://echarts.apache.org/examples/en/editor.html?c=pie-simple

@Ovilia, the demo provided by you does not support selection for pie chart.

Use this demo:
https://www.echartsjs.com/examples/en/editor.html?c=pie-rich-text

Select a sector and then filter out that selected sector using the legend.

o, I see. You mean, after the previous selected item has been removed, the selected state would be applied to next slice.. It seems a bug ? @Ovilia .
I guess the selected state is bind to index of item in data array, not item ID, which cause this to happen.

Yes. This is a bug. I think @alex2wong 's guess is promising. Do you wish to make a pull request? Thanks!

@Ovilia : I am working on this issue and got a question:

Even I set all the legends in selectedMap to be false, there is still one pie chart that gets selected. I doubt it might not be a bug in legend, but in pie chart.

Screen Shot 2019-12-27 at 2 30 08 PM

@daming-lu that's it ! the data name should be passed into seriesModal.isSelected to get the selected state instead of idx. idx is the newIdx of data after piePiece.updateData. Thanks ~

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jarben picture jarben  ·  3Comments

Thinkpad93 picture Thinkpad93  ·  3Comments

publisherfk picture publisherfk  ·  3Comments

Cyycl picture Cyycl  ·  3Comments

akvaliya picture akvaliya  ·  3Comments