0

I have a simple DOUGHNUT chart with two slices. The default color is red and blue. I'd like to change the color to a lighter red and green.

This is setting both slices to green

#Doughnut
doughnutchart_data = ChartData()
doughnutchart_data.categories = ['incomplete','completed']
doughnutchart_data.add_series('YTD COMPLETION TO PLAN', (49.5,50.5))


# add chart to slide
x, y, cx, cy = Inches(6.6), Inches(0.8), Inches(4), Inches(3)
ThisDoughnutChart = ThisSlide.shapes.add_chart(
    XL_CHART_TYPE.DOUGHNUT, x, y, cx, cy, doughnutchart_data
).chart

ThisDoughnutChart.has_legend = False

ThisDoughnutChart.series[0].format.fill.solid()
ThisDoughnutChart.series[0].format.fill.fore_color.rgb = RGBColor(13,230,2) # Green
Mattman85208
  • 1,858
  • 2
  • 29
  • 51

1 Answers1

1

Try:

point = chart.series[0].points[0]
fill = point.format.fill
fill.solid()
fill.fore_color.rgb = RGBColor(13, 230, 2)
scanny
  • 26,423
  • 5
  • 54
  • 80