scanny / python-pptx

Create Open XML PowerPoint documents in Python
MIT License
2.4k stars 519 forks source link

Data Labels Not Found for Doughnut Chart #891

Closed ssho25 closed 11 months ago

ssho25 commented 1 year ago

image <html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">

**showing the 'edit data' result from the doughnut chart in powerpoint**

A1 | 7.8 -- | -- A2 | 23.1 A3 | 0 A4 | 9.4 B1 | 13.2 B2 | 24.7 B3 | 7.2

Data is populating a doughnut chart as shown but when using any of the following in Visual Studio Code:

The series appears blank (' '). A series is found containing the numerical values but not A1, A2, A3 etc. I am trying to assign hex colours to A1, A2, A3 etc. and cannot assign them to the numerical values as these change throughout the year. Is this a weakness in the code?

scanny commented 11 months ago

A Donut chart is a stylized Pie Chart. A pie chart has .categories and a single .series.

I think you're looking for chart.categories which is where the A1, A2 bit comes from. This corresponds to the X-axis in a bar chart (column chart more precisely).