Skip to content Skip to sidebar Skip to footer

How Do You Set The Font Size Of A Chart Title With Python Pptx?

I add a chart with: doughnutchart_data.add_series('YTD COMPLETION TO PLAN', (PerformancePercent, NotPerformedPercent)) This gives me a chart title with the text, but how do I chan

Solution 1:

It seems that creating a chart title text_frame over writes the title applied from the add_series attribute. So I tried adding a new title. This worked for me:

 ThisDoughnutChart.chart_title.text_frame.text = 'YTD COMPLETION TO PLAN'
 ThisDoughnutChart.chart_title.text_frame.paragraphs[0].font.size = Pt(12)

Solution 2:

Version 0.6.11 another example

shape = slide.shapes
title_shape = shape.title
title_shape.text_frame.paragraphs[0].font.size=Pt(10)

Solution 3:

You can set the global font size of the chart with the following:

ThisDoughnutChart.font.size = Pt(10)

Post a Comment for "How Do You Set The Font Size Of A Chart Title With Python Pptx?"