a:graphicData (Graphic Data Container)
Container for namespace-specific graphic content (charts, SmartArt, pictures, tables).
Parent elements
Child elements
Description
a:graphicData is the payload container within a:graphic that holds namespace-specific content. It is defined in ECMA-376 Part 1 §20.1.2.2.
The uri attribute determines what type of content is inside and what namespace applies to child elements:
- Charts (
http://schemas.openxmlformats.org/drawingml/2006/chart) – Containsc:chart - Pictures (
http://schemas.openxmlformats.org/drawingml/2006/picture) – Containspic:pic - SmartArt/Diagrams (
http://schemas.microsoft.com/office/word/2010/wordprocessingShape) – Contains diagram elements - Tables (DrawingML
a:tbl) - Other custom content – Extensibility point for application-specific data
The actual child elements depend on the URI; the namespace declares which XML schema applies to the content inside.
Attributes
| Attribute | Type | Possible Values | Description |
|---|---|---|---|
uri |
xsd:anyURI |
Namespace URI (see common values below) | Identifies the content type and namespace of child elements. |
Common URI Values:
http://schemas.openxmlformats.org/drawingml/2006/chart– Chart contenthttp://schemas.openxmlformats.org/drawingml/2006/picture– Picture contenthttp://schemas.microsoft.com/office/word/2010/wordprocessingShape– Word shapehttp://schemas.microsoft.com/office/word/2010/wordprocessingDrawing– Word drawinghttp://schemas.microsoft.com/office/visio/2010/visioDocument– Visio diagram
Examples
Picture Content (Chart Namespace)
<a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/chart">
<c:chart xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart"
xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
r:id="rId2"/>
</a:graphicData>
using DocumentFormat.OpenXml.Drawing;
var graphicData = new GraphicData
{
Uri = "http://schemas.openxmlformats.org/drawingml/2006/chart"
};
// Chart content would be added here via relationship ID
Picture Content (Picture Namespace)
<a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/picture">
<pic:pic xmlns:pic="http://schemas.openxmlformats.org/drawingml/2006/picture"
xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
<pic:nvPicPr>
<pic:cNvPr id="1" name="Picture 1"/>
<pic:cNvPicPr/>
</pic:nvPicPr>
<pic:blipFill>
<a:blip r:embed="rId3"/>
<a:stretch><a:fillRect/></a:stretch>
</pic:blipFill>
<pic:spPr>
<a:xfrm>
<a:off x="0" y="0"/>
<a:ext cx="1828800" cy="1371600"/>
</a:xfrm>
<a:prstGeom prst="rect"><a:avLst/></a:prstGeom>
</pic:spPr>
</pic:pic>
</a:graphicData>
var graphicData = new GraphicData
{
Uri = "http://schemas.openxmlformats.org/drawingml/2006/picture"
};
// Picture element (pic:pic) would be added here
// Note: Picture XML structure is complex; typically generated by Office applications
Table Content
<a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/table">
<a:tbl>
<a:tblPr/>
<a:tblGrid>
<a:gridCol w="1828800"/>
<a:gridCol w="1828800"/>
</a:tblGrid>
<a:tr h="914400">
<a:tc>
<a:txBody><a:bodyPr/><a:p><a:r><a:t>Cell 1</a:t></a:r></a:p></a:txBody>
<a:tcPr/>
</a:tc>
<a:tc>
<a:txBody><a:bodyPr/><a:p><a:r><a:t>Cell 2</a:t></a:r></a:p></a:txBody>
<a:tcPr/>
</a:tc>
</a:tr>
</a:tbl>
</a:graphicData>
var graphicData = new GraphicData
{
Uri = "http://schemas.openxmlformats.org/drawingml/2006/table"
};
// Table content (a:tbl) would be added here
Notes
- The
uriattribute is critical – it determines the XML schema and namespace for child elements. - Namespace declarations on child elements are required to distinguish between different XML schemas.
- Relationship IDs (r:embed, r:link) are used to reference external resources like images and charts.
- The
a:graphicDataelement is always the only child ofa:graphic. - Child element names and structure depend entirely on the declared URI; there’s no fixed schema.
- Common content types (charts, pictures) use established namespaces; custom content can use custom URIs.