You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "Justin-ZS (via GitHub)" <gi...@apache.org> on 2025/08/28 04:07:09 UTC
[PR] fix(datalabel): hideOverlap not work on emphasis state [echarts]
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-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [PR] fix(datalabel): hideOverlap not work on emphasis state [echarts]
Posted by "Ovilia (via GitHub)" <gi...@apache.org>.
Ovilia commented on PR #21233:
URL: https://github.com/apache/echarts/pull/21233#issuecomment-3414136435
@Justin-ZS Hi, I've voted you to be a committer of Apache ECharts due to your continuous contribution. Can you provide an Email address for me to send our invitation. Please add my We-chat oviliazhang with a note "Justin-ZS" so that I can add you to our committer group. Thanks!
--
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-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [PR] fix(datalabel): hideOverlap not work on emphasis state [echarts]
Posted by "echarts-bot[bot] (via GitHub)" <gi...@apache.org>.
echarts-bot[bot] commented on PR #21233:
URL: https://github.com/apache/echarts/pull/21233#issuecomment-3231784526
Thanks for your contribution!
The community will review it ASAP. In the meanwhile, please checkout [the coding standard](https://echarts.apache.org/en/coding-standard.html) and Wiki about [How to make a pull request](https://github.com/apache/echarts/wiki/How-to-make-a-pull-request).
--
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-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [PR] fix(datalabel): hideOverlap not work on emphasis state [echarts]
Posted by "Justin-ZS (via GitHub)" <gi...@apache.org>.
Justin-ZS commented on PR #21233:
URL: https://github.com/apache/echarts/pull/21233#issuecomment-3305180581
@plainheart @pissang Could you help to review the PR? Thanks!
--
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-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [PR] fix(datalabel): hideOverlap not work on emphasis state [echarts]
Posted by "Justin-ZS (via GitHub)" <gi...@apache.org>.
Justin-ZS commented on PR #21233:
URL: https://github.com/apache/echarts/pull/21233#issuecomment-3580605921
@plainheart @100pah Could you help to review? Thanks!
--
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-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [PR] fix(datalabel): hideOverlap not work on emphasis state [echarts]
Posted by "vojtechportes (via GitHub)" <gi...@apache.org>.
vojtechportes commented on PR #21233:
URL: https://github.com/apache/echarts/pull/21233#issuecomment-4044391237
Is there any chance this will be reviewed any time soon?
--
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-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [PR] fix(datalabel): hideOverlap not work on emphasis state [echarts]
Posted by "echarts-bot[bot] (via GitHub)" <gi...@apache.org>.
echarts-bot[bot] commented on PR #21233:
URL: https://github.com/apache/echarts/pull/21233#issuecomment-3232485747
To reviewers: If this PR is going to be described in the changelog in the future release, please make sure this PR has one of the following labels: `PR: doc ready`, `PR: awaiting doc`, `PR: doc unchanged`
This message is shown because the PR description doesn't contain the document related template.
--
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-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [PR] fix(datalabel): hideOverlap not work on emphasis state [echarts]
Posted by "Justin-ZS (via GitHub)" <gi...@apache.org>.
Justin-ZS commented on PR #21233:
URL: https://github.com/apache/echarts/pull/21233#issuecomment-3420862992
> @Justin-ZS Hi, I've voted you to be a committer of Apache ECharts due to your continuous contribution. Can you provide an Email address for me to send our invitation. Please add my We-chat oviliazhang with a note "Justin-ZS" so that I can add you to our committer group. Thanks!
I’m so happy to hear that!
My Email is jzstxdy@gmail.com
--
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-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [PR] fix(datalabel): hideOverlap not work on emphasis state [echarts]
Posted by "Justin-ZS (via GitHub)" <gi...@apache.org>.
Justin-ZS commented on PR #21233:
URL: https://github.com/apache/echarts/pull/21233#issuecomment-3695365679
@plainheart @pissang Could you help to review the PR? Thanks!
--
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-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [PR] fix(datalabel): hideOverlap not work on emphasis state [echarts]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #21233:
URL: https://github.com/apache/echarts/pull/21233#issuecomment-3243598699
The changes brought by this PR can be previewed at: https://echarts.apache.org/examples/editor?version=PR-21233@abd13df
<!-- ECHARTS_PR_PREVIEW -->
--
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-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org
Re: [PR] fix(datalabel): hideOverlap not work on emphasis state [echarts]
Posted by "Justin-ZS (via GitHub)" <gi...@apache.org>.
Justin-ZS commented on PR #21233:
URL: https://github.com/apache/echarts/pull/21233#issuecomment-3257185905
@100pah Could you help to review the PR? Thanks!
--
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-unsubscribe@echarts.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org