Commit 5b75569f authored by Britta Heymann's avatar Britta Heymann
Browse files

Change pie chart slightly to fit the labels in

They exploded out of the chart before when averaging.

refs #731
parent 28692cd6
Pipeline #17182 passed with stages
in 4 minutes and 43 seconds
......@@ -42,12 +42,12 @@ def parseDeliveryProbabilityReport(fileName):
def createDeliveryPieChart(created, delivered, delivery_prob):
"""Creates a graphical presentation of delivery probability."""
values=[delivery_prob, 1-delivery_prob]
labels=["delivered:\n{p:.1f}% ({t})".format(p=delivery_prob*100, t=delivered),
"not delivered:\n{p:.1f}% ({t})".format(p=(1-delivery_prob)*100, t=(created-delivered))]
labels=["delivered:\n{p:.1f}% ({t:.1f})".format(p=delivery_prob*100, t=delivered),
"not delivered:\n{p:.1f}% ({t:.1f})".format(p=(1-delivery_prob)*100, t=(created-delivered))]
# Create pie chart.
fig1, ax1 = plt.subplots()
_, texts = ax1.pie(values, labels=labels, shadow=True, explode=(0.1, 0), labeldistance=0.3)
_, texts = ax1.pie(values, labels=labels, shadow=True, explode=(0.1, 0), labeldistance=0.2)
for text in texts:
text.set_fontsize(12)
ax1.axis('equal') # Equal aspect ratio ensures that pie is drawn as a circle.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment