-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pie Chart with % sum > 100% #3987
Comments
In this kind of situation, I don't really know what to expect. This is obviously a truncation/rounding problem. Having less or more than 100% is the same problem in my opinion. To take a more classic example:
Every section is one third, which would give 33% for each section. To solve that (and get a total of 100%, not 99%), the only solution I can see would be to round up a section to 34%, which does not really make sense to me. |
That is because of rounding. |
What do you think must be the behavior in the case with one third? pie
"Dogs" : 10
"Cats" : 10
"Rats" : 10
|
Maybe yes ,this is more representative of the equality between each elements |
Hi @NXML, in that case, if you're happy to have 33% / 33% / 33% not adding up perfectly to 100%, would you also be comfortable if we leave 33% / 33% / 35% adding up to nearly (but not exactly) 100%? |
Another possibility would be to display the raw values, not the (rounded) percentages, on the pie chart. But if we make this change, it would almost certainly make some folks unhappy. So we'd probably need to leave the labels as percentages by default, and have the raw values as a configurable option ... so we would still have the rounding issue with percentages anyway. So this wouldn't fix the problem. :) [edit] and this would be a feature request, not a bug fix. |
Description
On mermaid.live, when i put this diagram
pie title Pets adopted by volunteers "Dogs" : 80 "Cats" : 86 "Rats" : 80
Percentages are 33% , 35% and, 33% , the sum of these percentages are 101%,
That is not correct
Steps to reproduce
Go to https://mermaid.live/edit#pako:eNo9z00LwjAMBuC_EnLeYSeRXt1VEL3mEtc4i2s72lQYY__d-jFzCg8vvMmCfbSCBicnoE5HgZNoBrZxUrFwneEZxxJUJGUKUIewi0MmBAP7dqMD6492G53_1GKDXpJnZ2vT8g4Q6l28EJq6Wk4PQgprzXHReJlDj0ZTkQbLZFmlczwk9mhuPOaqYp3GdPye_vlgfQEK10AX
Screenshots
Code Sample
Setup
Desktop
Additional Context
No response
The text was updated successfully, but these errors were encountered: