So I am trying to reproduce the following XML as part of a test for chart addition:
</p:nvGraphicFramePr>
<p:xfrm>
<a:off x="1524000" y="1397000"/>
<a:ext cx="6096000" cy="4064000"/>
</p:xfrm>
<a:graphic>
<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>
</a:graphic>
</p:graphicFrame>
And I get everything to work fine except creating the line:
<c:chart xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" r:id="rId2"/>
The code for this relevant portion is:
Graphic g = new Graphic();
GraphicData gd = new GraphicData();
gd.setUri("http://schemas.openxmlformats.org/drawingml/2006/chart");
org.docx4j.dml.chart.ObjectFactory factory = new org.docx4j.dml.chart.ObjectFactory();
CTRelId ctrelid = new CTRelId();
ctrelid.setId(relId);
JAXBElement<CTRelId> e = factory.createChart(ctrelid);
gd.getAny().add(e);
g.setGraphicData(gd);
What the above code produces (again in the relevant portion is):
<a:graphic>
<a:graphicData uri="http://schemas.openxmlformats.org/drawingml/2006/chart">
<c:chart r:id="rId2"/>
</a:graphicData>
</a:graphic>
As you can see the <c:chart is missing the xlmns:c and xmlns:r that is in the Powerpoint generated version....
What am i doing wrong?
Any help appreciated.
Thanks,
Rob