Justin-ZS opened a new pull request, #21233:
URL: https://github.com/apache/echarts/pull/21233

   ## Brief Information
   
   This pull request is in the type of:
   - [x] bug fixing
   
   ### What does this PR do?
   
   Fix hideOverlap not working on emphasis state for data labels.
   
   ### Fixed issues
   
   - #20744
   <img width="278" height="297" alt="截屏2025-
   08-28 12 05 37" 
src="https://github.com/user-attachments/assets/147fa8ae-0b95-47eb-9c41-cd2acfcbcd0b";
 />
   <img width="400" height="294" alt="截屏2025-08-28 12 05 30" 
src="https://github.com/user-attachments/assets/42a247d8-11fa-418b-ac58-45c594afb02f";
 />
   
   
   ## Details
   
   ### Before: What was the problem?
   
   When data labels have `hideOverlap` enabled, all overlapping labels are 
forcibly displayed during emphasis state (hover or other emphasis triggers), 
completely ignoring the overlap detection settings. This causes dense label 
overlapping and affects readability.
   
   ### After: How does it behave after the fixing?
   
   - Emphasis labels get the highest display priority
   - Other labels that overlap with emphasis labels are intelligently hidden
   - Non-overlapping labels display normally
   - Original overlap handling logic is restored when exiting emphasis state
   
   **Fix Method:**
   1. Added `EmphasisManager` class to manage label overlap during emphasis 
state
   2. Used reordering mechanism to give emphasis labels highest priority
   3. Modified `hideOverlap` function to support pre-ordered mode, emphasis 
state labels also follow overlap rules
   4. Added state listeners for dynamic overlap handling
   
   ## Document Info
   
   - [x] This PR doesn't relate to document changes
   <!-- Please fill in the following information to help us review your PR more 
efficiently. -->
   
   ## Brief Information
   
   This pull request is in the type of:
   
   - [ ] bug fixing
   - [ ] new feature
   - [ ] others
   
   
   
   ### What does this PR do?
   
   <!-- USE ONE SENTENCE TO DESCRIBE WHAT THIS PR DOES. -->
   
   
   
   ### Fixed issues
   
   <!--
   - #xxxx: ...
   -->
   
   
   ## Details
   
   ### Before: What was the problem?
   
   <!-- DESCRIBE THE BUG OR REQUIREMENT HERE. -->
   
   <!-- ADD SCREENSHOT HERE IF APPLICABLE. -->
   
   
   
   ### After: How does it behave after the fixing?
   
   <!-- THE RESULT AFTER FIXING AND A SIMPLE EXPLANATION ABOUT HOW IT IS FIXED. 
-->
   
   <!-- ADD SCREENSHOT HERE IF APPLICABLE. -->
   
   
   
   ## Document Info
   
   One of the following should be checked.
   
   - [ ] 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: commits-unsubscr...@echarts.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org
For additional commands, e-mail: commits-h...@echarts.apache.org

Reply via email to