
From: Jaroslav Klapálek <klapajar@fel.cvut.cz> --- Tohle by mělo stačit na řešení problému :) app.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index 4989ee0..d009705 100644 --- a/app.py +++ b/app.py @@ -124,8 +124,12 @@ def coffee_graph_flavors(): fig = plt.figure(figsize=(3, 3)) ax = fig.add_subplot(111) ax.set_aspect(1) - ax.pie(counts, autopct=lambda p: '{:.0f}'.format(p * sum(counts)/100) if p != 0 else '', - normalize=True) + if "normalize" in matplotlib.pyplot.pie.__code__.co_varnames: + ax.pie(counts, autopct=lambda p: '{:.0f}'.format(p * sum(counts)/100) if p != 0 else '', + normalize=True) + else: + ax.pie(counts, autopct=lambda p: '{:.0f}'.format(p * sum(counts)/100) if p != 0 else '') + ax.legend(flavors, bbox_to_anchor=(1.0, 1.0)) if "uid" in session: -- 2.7.4