Seemingly arbitrary restriction on hole size for doughnut charts

Issue #1290 resolved
not_a_seagull created an issue

While opening an excel spreadsheet that contained a doughnut chart, I received an error stating that the file could not be opened because the minimum value for the hole size of the doughnut chart was 10%. For context, the file I was attempting to open had a doughnut chart with a hole size of 5%.

I looked into the code and I found this code in the “pie_chart.py” file in the “charts” directory.

holeSize = NestedMinMax(min=10, max=90, allow_none=True)

I was able to simply change it to the following:

holeSize = NestedMinMax(min=5, max=90, allow_none=True)

I would recommend that a similar change is reflected in the main repo, as the restriction on the hole size seems somewhat arbitrary.

Comments (2)

  1. CharlieC

    Thanks for the report. When I was initially adding support for Doughnut charts I took a best guess based on the specification. Looking again at the regex 0*([1-9]|([1-8][0-9])|90)% it does look like it could be improved on, with the lower bound being 1%but I think the upper bound should remain 90%. Notice how the specification allows this to be expressed as a percentage.

  2. Log in to comment