scanny / python-pptx

Create Open XML PowerPoint documents in Python
MIT License
2.26k stars 498 forks source link

Second label as percentage - possible to visualize? #953

Open sw4gyJohnson opened 3 months ago

sw4gyJohnson commented 3 months ago

Hi,

im kinda new in python and trying out this library to automate a monthly report by changing values in my Powerpoint. So far i was able to replace the data from my presentation but i want to modify the data label of my bar chart, so i can display the percentage rise of my values on the same bar or like anywhere else. I tried to use the data_label object but i didnt manage to make it work.

Basically thats the setup i want to visualize (template presentation from the docu-page):

image

here i can select the range of the values i want to add as second label to visualize the percentage rise via "value from cells"-option:

image

Can i make this work with the pptx-library? this seems to be a pretty specific task and my knowledge is limited? When i tried adding a second series with "percentage" and the percentages, it will always create a new series that will get selected as data automatically and will be displayed as whole bar itself. You can see the values of percentage beeing displayed as small bars at the bottom of february, march & january. (yellow marked) You can see, that i added random numbers in a new template here:

image

Thank you very much in advance!