You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "Resbi-Anik (via GitHub)" <gi...@apache.org> on 2026/04/15 13:46:15 UTC
[PR] fix(visualMap): prevent tooltip label overlap [echarts]
Resbi-Anik opened a new pull request, #21586:
URL: https://github.com/apache/echarts/pull/21586
- Introduced a new margin constant for handle label overlap detection.
- Added logic to merge handle labels when they overlap, improving visual clarity.
- Refactored handle label position updates to accommodate new merging behavior.
- Implemented a method to calculate the bounding rectangle of handle labels for accurate overlap testing.
Resolves: #21585
## Brief Information
This pull request is in the type of:
- [x] bug fixing
- [ ] new feature
- [ ] others
### What does this PR do?
Prevents overlapping of visualMap handle tooltip labels when the slider handles are positioned close to each other.
### Fixed issues
- #21585: visualMap tooltip labels overlap when handles are close
## Details
### Before: What was the problem?
When using visualMap with `calculable: true`, the tooltip labels for the min and max values overlap when the slider handles are positioned close to each other.
This makes the labels unreadable and affects usability.
<img width="1801" height="960" alt="Screenshot 2026-04-15 at 5 21 26 PM" src="https://github.com/user-attachments/assets/50f97814-b921-46fc-9a77-adc5058b9672" />
### After: How does it behave after the fixing?
The tooltip labels no longer overlap when the handles are close.
When the distance between handles is below a threshold, the labels are adjusted/merged to maintain readability and avoid visual collision.
<img width="1907" height="767" alt="Screenshot 2026-04-15 at 5 50 28 PM" src="https://github.com/user-attachments/assets/1aeffd7b-f331-43dc-a0a7-e7e427b41103" />
## 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
### Security Checking
- [ ] This PR uses security-sensitive Web APIs.
### ZRender Changes
- [ ] This PR depends on ZRender changes (ecomfe/zrender#xxx).
### Merging options
- [x] Please squash the commits into a single one when merging.
### Other information
Tested with heatmap and visualMap slider in minimal configuration. The fix works without requiring additional user configuration.
--
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(visualMap): prevent tooltip label overlap [echarts]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #21586:
URL: https://github.com/apache/echarts/pull/21586#issuecomment-4278251819
The changes brought by this PR can be previewed at: https://echarts.apache.org/examples/editor?version=PR-21586@5979d16
<!-- 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(visualMap): prevent tooltip label overlap [echarts]
Posted by "Resbi-Anik (via GitHub)" <gi...@apache.org>.
Resbi-Anik commented on PR #21586:
URL: https://github.com/apache/echarts/pull/21586#issuecomment-4278087087
Hi @Justin-ZS ,
Could you please approve the workflow so the checks can run?
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(visualMap): prevent tooltip label overlap [echarts]
Posted by "Resbi-Anik (via GitHub)" <gi...@apache.org>.
Resbi-Anik commented on PR #21586:
URL: https://github.com/apache/echarts/pull/21586#issuecomment-4278297984
Hi @Justin-ZS,
All checks have passed, and the PR looks ready.
Could a maintainer please merge when possible? 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(visualMap): prevent tooltip label overlap [echarts]
Posted by "Resbi-Anik (via GitHub)" <gi...@apache.org>.
Resbi-Anik commented on PR #21586:
URL: https://github.com/apache/echarts/pull/21586#issuecomment-4266863691
> Thanks for the fix, the overlap handling logic looks solid and the `handleIndex === 'all'` hover-link update also makes sense.
>
> Could you also add a small regression case in `test/visualMap-continuous.html` (or a new visualMap HTML case) to cover both states:
>
> 1. labels overlap and are merged;
> 2. labels separate again and return to two draggable labels.
>
> That would help guard against future regressions in label visibility/draggability transitions.
I have updated the PR with new regression case :
<img width="1286" height="1011" alt="Screenshot 2026-04-17 at 3 31 27 PM" src="https://github.com/user-attachments/assets/f62ff105-40bb-4ac9-beb0-fb1fe6497a58" />
e:
--
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(visualMap): prevent tooltip label overlap [echarts]
Posted by "Resbi-Anik (via GitHub)" <gi...@apache.org>.
Resbi-Anik commented on PR #21586:
URL: https://github.com/apache/echarts/pull/21586#issuecomment-4368116652
Hi @Justin-ZS , Would you mind merging the PR, as there have been no new comments over the last three weeks?
--
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(visualMap): prevent tooltip label overlap [echarts]
Posted by "Justin-ZS (via GitHub)" <gi...@apache.org>.
Justin-ZS commented on PR #21586:
URL: https://github.com/apache/echarts/pull/21586#issuecomment-4279658798
> Hi @Justin-ZS, All checks have passed, and the PR looks ready. Could you please merge when possible? Thanks!
Since ECharts 6.1 is coming this week, I’ll merge it after the 6.1 release if there are no further comments from other maintainers.
--
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(visualMap): prevent tooltip label overlap [echarts]
Posted by "echarts-bot[bot] (via GitHub)" <gi...@apache.org>.
echarts-bot[bot] commented on PR #21586:
URL: https://github.com/apache/echarts/pull/21586#issuecomment-4515919753
Congratulations! Your PR has been merged. Thanks for your contribution! 👍
--
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(visualMap): prevent tooltip label overlap [echarts]
Posted by "Resbi-Anik (via GitHub)" <gi...@apache.org>.
Resbi-Anik commented on PR #21586:
URL: https://github.com/apache/echarts/pull/21586#issuecomment-4515092858
Hi @Justin-ZS , Would you mind merging the PR, since version 6.1 has been released?
--
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(visualMap): prevent tooltip label overlap [echarts]
Posted by "Justin-ZS (via GitHub)" <gi...@apache.org>.
Justin-ZS commented on PR #21586:
URL: https://github.com/apache/echarts/pull/21586#issuecomment-4266727674
Thanks for the fix, the overlap handling logic looks solid and the hover-link update also makes sense.\n\nCould you also add a small regression case in (or a new visualMap HTML case) to cover both states:\n1) labels overlap and are merged;\n2) labels separate again and return to two draggable labels.\n\nThat would help guard against future regressions in label visibility/draggability transitions.
--
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(visualMap): prevent tooltip label overlap [echarts]
Posted by "echarts-bot[bot] (via GitHub)" <gi...@apache.org>.
echarts-bot[bot] commented on PR #21586:
URL: https://github.com/apache/echarts/pull/21586#issuecomment-4252593340
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).
Please **DO NOT** commit the files in [dist](https://github.com/apache/echarts/tree/master/dist), [i18n](https://github.com/apache/echarts/tree/master/i18n), and [ssr/client/dist](https://github.com/apache/echarts/tree/master/ssr/client/dist) folders in a non-release pull request. These folders are for release use only.
--
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(visualMap): prevent tooltip label overlap [echarts]
Posted by "Justin-ZS (via GitHub)" <gi...@apache.org>.
Justin-ZS merged PR #21586:
URL: https://github.com/apache/echarts/pull/21586
--
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