0

I have a template slide having two pie-charts. I need to change chart data for the charts. I am new to python pptx so not sure how I approach it.I have following code where i have entered the loop where I have the chart shape:

prs = Presentation(pptFilepath)
for slide,site in zip(prs.slides,sites):
    for shape in slide.shapes:
        print(shape.name)
        if shape.has_chart: 
            print("yes")

This results in two yes meaning I have two charts. but how do I access the chart data and how can I change it as per my liking?

Kathan Vyas
  • 355
  • 3
  • 16
  • What phrase did you search on? "python-pptx change chart data" brings this up as the first result: https://stackoverflow.com/questions/54991741/python-pptx-update-or-change-existing-chart-data – scanny Jun 29 '21 at 00:02
  • @scanny I saw this however they do not mention how I could see the data already present – Kathan Vyas Jun 29 '21 at 14:58
  • https://stackoverflow.com/questions/58818347/read-chart-data-from-existing-chart-using-python-pptx – scanny Jun 29 '21 at 16:06

0 Answers0