echarts icon indicating copy to clipboard operation
echarts copied to clipboard

fix: legend inverse bug

Open caiwukun opened this issue 3 years ago • 1 comments

Brief Information

This pull request is in the type of:

  • [x] bug fixing
  • [ ] new feature
  • [ ] others

What does this PR do?

remove legend name duplicate to fix legend inverse bug

Details

Before: What was the problem?

legend selector inverse function not work when using multiple series with duplicate legend name reproduce link In the demo, you can see the legend reverse don't work, It's beacase there are many duplicate legend name in pie chart series data, and legend reverse function will traverse these legend names, which will cause multiple times reverse of same legend name.

image

After: How does it behave after the fixing?

this fixing add dupliate removal before legend data update. After the fixing, the legend reverse function work normally!

Document Info

One of the following should be checked.

  • [x] This PR doesn't relate to document changes
  • [ ] The document should be updated later
  • [ ] The document changes have been made in apache/echarts-doc#xxx

Misc

ZRender Changes

  • [ ] This PR depends on ZRender changes (ecomfe/zrender#xxx).

Related test cases or examples to use the new APIs

N.A.

Others

Merging options

  • [ ] Please squash the commits into a single one when merging.

Other information

caiwukun avatar Aug 14 '22 06:08 caiwukun

Thanks for your contribution! The community will review it ASAP. In the meanwhile, please checkout the coding standard and Wiki about How to make a pull request.

echarts-bot[bot] avatar Aug 14 '22 06:08 echarts-bot[bot]

Congratulations! Your PR has been merged. Thanks for your contribution! 👍

echarts-bot[bot] avatar Sep 22 '22 10:09 echarts-bot[bot]