How to read text boxes inside the chart area python pptx?

为君一笑 提交于 2020-04-30 06:28:00

问题


I am trying to automate a ppt using pptx-python library. I'm using a template. There are few charts in some of the slides. And charts have text boxes in it. I tried looping over the shapes to get the shape_id of those text boxes but I couldn't find the shape_id.

And when I tried to drag the text box out of the chart area it didn't come out. It seems the text box is part of the chart area. There are two areas chart area and plot area and text boxes are inside the chart area and plot area contains the bars of bar chart.

Original

[1]

When I shrink downed the plot area, the text boxes are still at there original position

[2]

Can anyone tell me how to locate those text boxes using python-pptx? I want to replace those XXX with my own text.

Text boxes are the part of the plot area.

Note: If this is already asked then please put up the link of that post in the comments. Thank you.

Added the XML Schema of the ppt you can see the text I want to replace. Can anyone tell me how to traverse through it using python-pptx?

来源:https://stackoverflow.com/questions/61383528/how-to-read-text-boxes-inside-the-chart-area-python-pptx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!