You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2022/11/23 18:23:00 UTC

[GitHub] [echarts] jbrachey opened a new issue, #17962: [Bug] Pie chart percentages are wrong after removing any pie slices

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

   ### Version
   
   5.4.0
   
   ### Link to Minimal Reproduction
   
   https://echarts.apache.org/examples/en/editor.html?c=pie-simple&code=PYBwLglsB2AEC8sDeAoWtJgDYFMBcya6GOAHmAQOQBKOAZjgE5OzB2wCGsA6jgEYBnCGByUANEXQCArnxHkqAMQ4BrHLAAiHMB3GTYuOhViUAxjmgjGlIgF8J6MMGBZIIAqmIZGEAOa-mKmEcAFsbdHsiXADoABMPfWAfC2NKADcmSFMOLD0vQ1SC8NhIqSYIHAECAG19Ty9YaA4Q_BMAQVNzAQFYRUZgMIcGsABPEFbKEAq8hsYOWIhpKpMAVgAGAFIZ_I4-HCwEhuI6JJDtKyokWNstoa9ShtjtDhr9LyRYNJzpVoBGNYALAAOMSNZoTADKOA4jFMAAtYABRaC-CDQUQlO4ND5fLA_AgAdgAzCtQU0WlQNBBmKYwJRMW9iDjvq0VkC1mTwVREWcILkGUd0My8a1gQDORSTABVaBQOBtWICekPI7C_GwIlrDlgyWUABqEFiOGAsAVSpKjIAulj0KEQHCOEJlvUjsEQhDRrhDoKpA7YsAAO4AITxjAI_xtDQEfsDAHk6HQBDgwAANAgcxleaPzQMAYRcSSojF8fA4AAptZXQWsAHQrACUxSOtkZLfuREtKFsAG4gA
   
   ### Steps to Reproduce
   
   Simply click some categories on the legend to filter down the slices of the pie chart. The more slices you remove, the weirder the percentages get (all the way down to having only one slice displayed, and it doesn't show 100%).
   
   ### Current Behavior
   
   I am displaying a pie chart with labels displaying the percentage of each slice of the pie chart by putting this code 
   ```
   label: {
       formatter: '{d}%',
   },
   ```
   into the series field. Once the user deselects sections of the pie chart using the legend, the percentages shown as labels for the pie chart are not correct. The pie chart's sections are sized correctly, but the percentages do not match the section sizes or the actual data. This can lead to some really large issues with the percentages, like so:
   ![Screenshot 2022-11-23 130121](https://user-images.githubusercontent.com/65885692/203617317-8d1adede-a2c6-4426-902c-85b62817efbd.png)
   
   While this is an extreme example (after many sections of the pie chart were taken away), the percentages typically become inaccurate after just one section is removed from the pie chart, leading to smaller inconsistencies like this:
   ![Screenshot 2022-11-23 130530](https://user-images.githubusercontent.com/65885692/203617858-cd2f6882-7e27-4f88-9aa1-c213f4ce4282.png)
   
   This example is less severe, but still, the percentages do not add up to 100%, and the blue section should have a percentage larger than 33.3%. It may be worth noting that the percentage is also messed up when displaying it in the tooltip using the formatter.
   
   ### Expected Behavior
   
   The percentage labels should adjust correctly to be accurate after the user deselects some slices of the pie. The actual sizes of the slices are adjusting correctly, and the percentage labels should always correspond with the sizes of the slices. This would lead to correctly-labeled pie charts like this:
   ![Screenshot 2022-11-23 131419](https://user-images.githubusercontent.com/65885692/203619495-5289a9ea-34f8-4919-9831-c346c41a8ae3.png)
   (this screenshot is without deselecting any sections) even after the user removes some slices. On top of that, the percentages should always add up to 100%.
   
   ### Environment
   
   ```markdown
   - OS: Windows 11
   - Browser: Chrome
   - Framework: React
   ```
   
   
   ### Any additional comments?
   
   I've been using a pie chart with percentage labels for a while and don't believe I ever had this issue until just recently (I can't imagine I wouldn't have noticed it for so long since I frequently interact with the pie chart and remove slices). I see that some pie-chart related code was merged on November 15th, so I'm wondering if maybe that was when the bug originated. Please let me know if you have any questions. 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.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


[GitHub] [echarts] plainheart commented on issue #17962: [Bug] Pie chart percentages are wrong after removing any pie slices

Posted by GitBox <gi...@apache.org>.
plainheart commented on issue #17962:
URL: https://github.com/apache/echarts/issues/17962#issuecomment-1325924997

   Hi, it's fixed in #17734.


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


[GitHub] [echarts] echarts-bot[bot] closed issue #17962: [Bug] Pie chart percentages are wrong after removing any pie slices

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] closed issue #17962: [Bug] Pie chart percentages are wrong after removing any pie slices
URL: https://github.com/apache/echarts/issues/17962


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