Resbi-Anik opened a new issue, #21884:
URL: https://github.com/apache/echarts/issues/21884

   ### Version
   
   master (since 06cd2ea5f / #21637); 6.1.0 release is not affected
   
   ### Link to Minimal Reproduction
   
   
https://echarts.apache.org/examples/en/editor.html?code=dZC9bsMwDIT3PMVtXozEbptFRYd06tInMDwwMhMTkCVDop2kQd698E_bqRt5B348MvQqweMN9w2w2-E9aIuWfOM4oaWRoS0jUccYyQ1s5t7RkR2yfZFBElIbLh56EcvbhXJwKUDjzaCPbCVJ8AZFjkj-zAbVvtg-5dgX25c6R4gIUdirQTZyVLHksgk0ShrIfVJv5nSA3no2yGzwKn4IQ8ryWe9kxi81XQ3KYu1-wW2I8hW8kltnLDk7ODq66aQ48KL-BZzi1Yvo-DQhLHvluI5r6A2yTprG8SqJcvfBcm7V4LkoNsBjMq6HqySD-_wmgxO5xItz-9dJHIWTQXX_uTlZ0nk7GlIyqKoyR1nXeNSbx-s3&enc=deflate
   
   ### Steps to Reproduce
   
   > Note: the linked editor runs the released 6.1.0, which still merges the 
labels (#21586), so it does **not** show the bug. It reproduces on a build of 
current `master` (after 06cd2ea5f, #21637), e.g. with `npm run dev` and a local 
test page.
   
   1. Use a calculable continuous visualMap where both handles have the same 
value:
   
   ```js
   option = {
     visualMap: {
       type: 'continuous',
       min: 0,
       max: 100,
       orient: 'horizontal',
       calculable: true,
       range: [50, 50]
     },
     xAxis: { show: false },
     yAxis: { show: false },
     series: [{ type: 'scatter', data: [[1, 1]] }]
   };
   ```
   
   2. Or drag one handle onto the other in any calculable continuous visualMap.
   3. Also happens when two different values format to the same text, e.g. 
`precision: 0` with `range: [50.2, 50.4]`, and with `orient: 'vertical'`.
   
   ### Current Behavior
   
   Since #21637, overlapping handle labels are pushed apart instead of merged. 
When both handles have the same value, the same number is shown twice: `50 50` 
horizontally, or `50` stacked above `50` vertically. The duplicate adds no 
information and looks like a rendering glitch.
   
   This is not in a release yet (6.1.0 still shows one merged label), so it 
would be good to fix it before the next release.
   
   ### Expected Behavior
   
   When the two handle labels overlap and show the same text, show one label 
centered on the handles. Once the texts differ, show both labels again.
   
   Labels that are far apart should stay as two labels even if their text is 
the same (e.g. a constant `formatter`).
   
   ### Environment
   
   ```markdown
   - OS: macOS
   - Browser: Chrome
   - Framework: none
   ```
   
   ### Any additional comments?
   
   Current `master`: `range: [50, 50]` (horizontal and vertical) and 
`precision: 0, range: [50.2, 50.4]`:
   
   <img width="1520" height="800" alt="issueB-before" 
src="https://github.com/user-attachments/assets/137716c9-c615-4fd4-8cbf-cffba45da0e7";
 />
   
   I have a fix ready and will open a PR.


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

Reply via email to