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?

3
  • What phrase did you search on? "python-pptx change chart data" brings this up as the first result: stackoverflow.com/questions/54991741/… Commented Jun 29, 2021 at 0:02
  • @scanny I saw this however they do not mention how I could see the data already present Commented Jun 29, 2021 at 14:58
  • stackoverflow.com/questions/58818347/… Commented Jun 29, 2021 at 16:06

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.