Skip to content

Support pptx chart graph is a good idea #1504

@doublewill

Description

@doublewill

Of course, python-docx is great, in file docx/oxml/shape.py,class CT_GraphicalObjectData may be update ro render chart file,

The origin class:

class CT_GraphicalObjectData(BaseOxmlElement):
"""<a:graphicData> element, container for the XML of a DrawingML object."""

pic: CT_Picture = ZeroOrOne("pic:pic")  # pyright: ignore[reportAssignmentType]
uri: str = RequiredAttribute("uri", XsdToken)  # pyright: ignore[reportAssignmentType]

updated class
class CT_GraphicalObjectData(BaseOxmlElement):
"""<a:graphicData> element, container for the XML of a DrawingML object."""

pic: CT_Picture = ZeroOrOne("pic:pic")  # pyright: ignore[reportAssignmentType]
cChart = ZeroOrOne('c:chart')  
uri: str = RequiredAttribute("uri", XsdToken)  # pyright: ignore[reportAssignmentType]

By add cChart = ZeroOrOne('c:chart') ,charts tools such as python-pptx can be supported well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions