I am working on a sunburst chart, and am finding that the total percentage of the inner pie chart does not always add up to 100%, dependent on the data (sometimes 101%, other times 99% - dependent on the data).
Has anyone else had the problem? (I am very new so could be very simple).
My guess is that itβs just a rounding error. Some of the numbers probably have been rounded up (for ex, 25% is actually 24.6% and 19% is 18.8%). Probably if you add the percentages with decimal positions the result will be 100%.
Thanks for the answer, that is what I suspected. Is there any way to ensure this central pie adds to 100%, I am trying to role this out, and am sure that this minor detail will be picked up on.
If your figure is called fig that can be done like this: fig.update_traces(texttemplate = '%{label}<br>%{percentRoot:.2%}')
In that case, you would have the name and the percentage with two decimals (ex. 25.78%). If you wanted only one decimal position it would be {percentRoot:.1%}' and so on.