caiwukun opened a new pull request, #17510: URL: https://github.com/apache/echarts/pull/17510
<!-- Please fill in the following information to help us review your PR more efficiently. --> ## Brief Information This pull request is in the type of: - [x] bug fixing - [ ] new feature - [ ] others ### What does this PR do? <!-- USE ONE SENTENCE TO DESCRIBE WHAT THIS PR DOES. --> 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 [reporduce link](https://echarts.apache.org/examples/zh/editor.html?c=pie-simple&code=PYBwLglsB2AEC8sDeAoWszGAG0iAXMmuhgE4QDmFApqYQOQRjUC29xAvgDTHbU3QAJoVQkMoBgFYApPR5i-AMzAMAxtWjNSc4ugDO1Pqsx10AbV0lRYkmACeIagwCG2bDpu2mfBgEE3HjbclujWnvaODKTUAG60BoHh3k6w9ACS0HGkCfJBuegAurnB-rQQ1HqEFmJhJNDOLCn0vqrqenqwAGKkwGz5tg5NIOWJJOqatFX0AMwADLJcqZLz9EUhsKTOghAArpWwZvQALCuL9ADsK2uezjHAEIIAMs4ARoYA8lnYzgSwiq4GfroJisADK9h8RE86BewFIgloACUtrt9gBGWZAkiw-G0ADCODhDAAxIoyaMxDiEaQAOoPMAAC0IACZ1iUbN83tgROt9AzgAB3Qj_bCA3mwEDAPRMKDQNQaLTsTzssSsEAM5zS_a1BSvQw86EkPT8oVkHbULFiRQwMCgiAALyaJwpNmtmhp1EoDJUqVh2EESuhHDZWM5hkeEGgKR1RpNwoB1BD60EzjAziq4qQsBirnNhAxRwAHIt6o0GKDqM5SKoGbAAKLQCiR6j0WAqmxZnPYPOwc7TSQlhpNAAiEGixlb7Zq2dzKUkhcxsFLTTrLGcEHcbctyBn3ZSRaOg7LqQAqtBZbBfII9JPt53Z4Q5ovlwwAGoPajAS_XyfrAqWdsYxfVIWjaDpul6F0IiGEYsXGLQpkuBYliuLFNm2PYphOZCLlQ9ZbnuJ49WwT5aG-X4RTFTwQRYcE7EhGMYThalkQw9FMXFKl8UJUx6FJclty42l6SZWBWWVUNiINaFjUFeNRQtcVJWlSAYHlCZtCTTw1Q1LVpM8MNuShQ1YFk00wFIc1t3QN1bQdJ1ZhdK0bQ9L0fXoP0A3FYMJPWQyIyjfSb DM-SDC0mwUzTDNDXvPd81mIsjyaCsqxretG2bW9M13Hs-wHJchwYUdxzALKYpyucFyShhV3XTcpysCrCAParT3PGBvxvLdsq7Hsn1a-h3wRL8ry6nybH_MRxv_DgAG4gA) 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. <!-- DESCRIBE THE BUG OR REQUIREMENT HERE. --> <!-- ADD SCREENSHOT HERE IF APPLICABLE. --> <img width="1659" alt="image" src="https://user-images.githubusercontent.com/30014294/184525409-bf51e553-3a18-45c4-adcb-46608ba71b8f.png"> ### After: How does it behave after the fixing? <!-- THE RESULT AFTER FIXING AND A SIMPLE EXPLANATION ABOUT HOW IT IS FIXED. --> 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 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
