google / google-visualization-issues

288 stars 35 forks source link

Pie Chart Sometimes Not Adding Up to 100% #3002

Open jarfer opened 9 months ago

jarfer commented 9 months ago

If you use Pie Charts a lot with raw data, you'll start seeing examples where Google Charts does not correctly (or accurately enough) compute percentage sizes, leading to a pie chart that has something like 99.9% totals.

There is never a scenario where such output is to be expected or hoped for (or even correct). Was this never fully tested?Any pie chart is it must add up to 100% (correct me if I'm wrong) or else you don't actually have a pie chart in meaningful terms.

Digging into this, I think it's due to rounding: were the pie chart drawn with 2dp rounding I suspect this may work, but since the developer won't necessarily know as this will be down to the dataset being used, can I suggest Google ensure all pie charts add up to 100%? pie-chart