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: [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]
