gyli / PyWaffle

đŸ§‡ Make Waffle Charts in Python.
MIT License
578 stars 105 forks source link

fixed a bug caused by two or more consecutive empty fields in the dat… #24

Closed raoulrosenthal closed 2 years ago

raoulrosenthal commented 2 years ago

I fixed a small bug that occurs when there are two empty fields in the data by changing an if statement with a while statement . To reproduce the bug:

plt.figure( FigureClass=Waffle, rows=5, columns=10, values=[48, 0,0,46, 3], rounding_rule='floor' ) fig.show()

gyli commented 2 years ago

Thank you for noticing the issue and your code! I found that your fix might not work when the continuous zeros are at the end of the value list, like values=[48, 46, 0, 0,]. So I update your solution by adding one more condition in the while loop. Please check https://github.com/gyli/PyWaffle/commit/5c09e69c58911c187f5ab99426a233f76bfa3b01