You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "Feather130 (via GitHub)" <gi...@apache.org> on 2024/01/23 07:46:09 UTC

[I] Pie chart setting moveOverlap, when all data is 0, the label undergoes a positional shift[Bug] [echarts]

Feather130 opened a new issue, #19533:
URL: https://github.com/apache/echarts/issues/19533

   ### Version
   
   5.4.3
   
   ### Link to Minimal Reproduction
   
   https://echarts.apache.org/examples/zh/editor.html?code=PYBwLglsB2AEC8sDeAoWtJgDYFMBcya6GOAHmAQOQBKOAZjgE5OzB2wCGsA6jgEYBnCGByUANEXQCArnxHkqAMQ4BrHLAAiHMB3GTYuOhViUAxjmgjGlIgF8J6MMGBZIIAqmIZGEAOa-mKmEcAFsbdHsiXADoABMPfWAfC2NKADcmSFMOLD0vQ1SC8NhIqSYIHAECAG19Ty9YaA4Q_BMAQVNzAQFYRUZgMIcGsABPEFbKEAq8hsYOWIhpKpMAVgAGAFIZr1jtDhr9LyRYNJzpVrWxRuaJgGUcDkZTAAtYAFFoXwhoURKhhuQJzOFyuTRaVA0EGYpjAlD-h2Ix1OWHOBEu13BJjeIQ4EFy8IB6CRwLRoJuVAAqtAoHA2rEBHDbAiALr_YhYDh8HBYAAyHBGwGkxnqAJCwAyAHkMowOe4TAJnhAjABNYpeUoNDlcrAJQmwBXAADuBDAjHObK8IGAQkgMCC0CEsVEFuIdCSOLAVioSFMtm2DTdlluEAAXq0AIwANgRGq8oRAzw4QmWIoawRCt1GuF1ev1idiRoAQijGARw5cEV4FfMjRK6HQBDgwAANUmV4jVguGgDCLiSVEYvj4HAAFOjx1c1gA6FYASjVDSZAKXxBXzJQtgA3EA
   
   ### Steps to Reproduce
   
   ```javascript
   option = {
     title: {
       text: 'Referer of a Website',
       subtext: 'Fake Data',
       left: 'center'
     },
     tooltip: {
       trigger: 'item'
     },
     legend: {
       orient: 'vertical',
       left: 'left'
     },
     series: [
       {
         name: 'Access From',
         type: 'pie',
         radius: '50%',
         data: [
           { value: 0, name: 'Search Engine' },
           { value: 0, name: 'Direct' },
           { value: 0, name: 'Email' },
           { value: 0, name: 'Union Ads' }
         ],
         labelLayout: {
           moveOverlap: 'shiftY'
         },
         label: {
           show: true,
           position: 'inside',
           formatter: '{c}',
           fontSize: 16
         },
         emphasis: {
           itemStyle: {
             shadowBlur: 10,
             shadowOffsetX: 0,
             shadowColor: 'rgba(0, 0, 0, 0.5)'
           }
         }
       }
     ]
   };
   ```
   
   ### Current Behavior
   
   Label offset
   
   ### Expected Behavior
   
   Label alignment
   
   ### Environment
   
   ```markdown
   - OS:
   - Browser:
   - Framework:
   ```
   
   
   ### Any additional comments?
   
   _No response_


-- 
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.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: [I] [Bug] Pie chart setting moveOverlap, when all data is 0, the label undergoes a positional shift [echarts]

Posted by "anentropic (via GitHub)" <gi...@apache.org>.
anentropic commented on issue #19533:
URL: https://github.com/apache/echarts/issues/19533#issuecomment-2700755587

   > Add `labelLayout.y:555` to activate _moveOverlap_. Related to [#17937](https://github.com/apache/echarts/issues/17937).
   > 
   > 📌 please close issue if problem solved.
   
   I don't think this suggestion fixes anything. The problem is not that `moveOverlap` was not activated, but instead that it shifted labels which didn't need shifting, spoiling what would have been a symmetrical alignment.
   
   The underlying problem in OP's example seems to be that `moveOverlap: 'shiftY'` shifts labels which share the same `y` value, even if they have different `x` values and so didn't actually overlap before shifting.
   
   that was probably simpler to implement than having to measure to width of the labels to check for actual overlaps I guess?
   
   the label widths are available in `labelLayout` callback function, but only for current label so I don't think it'd be possible to use that for making our own moveOverlap implementation


-- 
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: [I] [Bug] Pie chart setting moveOverlap, when all data is 0, the label undergoes a positional shift [echarts]

Posted by "helgasoft (via GitHub)" <gi...@apache.org>.
helgasoft commented on issue #19533:
URL: https://github.com/apache/echarts/issues/19533#issuecomment-1908770529

   Add ```labelLayout.y:555``` to activate _moveOverlap_. Related to #17937. 
   
   📌 please close issue if problem solved.


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