Pie Chart - 0% Values overlapping
Created originally on Bitbucket by dunnski007
I'm creating a pie chart and the values are all overlapping when more than 2 are 0%.
Is there a way to ensure the percentage labels do not overlap for the pie chart?
#!python
def createPieChart(ws, countRows):
pie = PieChart()
pie.dataLabels = DataLabelList()
pie.dataLabels.showPercent = True
#pie.dataLabels. -- fix overlapping 0s
#update start index
labels = Reference(ws, min_col=4, max_col=7, min_row=17)
data = Reference(ws, min_col=4, max_col=7, min_row=20+countRows)
pie.add_data(data, from_rows=True, titles_from_data=False)
pie.set_categories(labels)
pie.title = "Execution Breakdown"
pie.height = 7
pie.width = 10
ws.add_chart(pie, "I2")
Attachments: pieChartOverlapExampleExampleReport.xlsx