by gengstah » Wed Jun 16, 2021 8:53 pm
Hi Jason!
Thank you that worked! However, I can't open the generated Word doc after adding this in a WordprocessingMLPackage. Would you please guide me in the right direction on how to generate charts in runtime? What are the differences between embedding a spreadsheet and not embedding?
- Code: Select all
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.createPackage();
String openXML = "<c:chartSpace xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:c=\"http://schemas.openxmlformats.org/drawingml/2006/chart\" xmlns:c16r3=\"http://schemas.microsoft.com/office/drawing/2017/03/chart\" xmlns:c16=\"http://schemas.microsoft.com/office/drawing/2014/chart\">"
+ "<c:date1904 val=\"0\"/>"
+ "<c:lang val=\"en-US\"/>"
+ "<c:roundedCorners val=\"0\"/>"
+ "<c:style val=\"2\"/>"
+ "<c:chart>"
+ "<c:title>"
+ "<c:tx>"
+ "<c:rich>"
+ "<a:bodyPr anchor=\"ctr\" anchorCtr=\"1\" rot=\"0\" spcFirstLastPara=\"1\" vert=\"horz\" vertOverflow=\"ellipsis\" wrap=\"square\"/>"
+ "<a:lstStyle/>"
+ "<a:p>"
+ "<a:pPr>"
+ "<a:defRPr b=\"0\" baseline=\"0\" i=\"0\" kern=\"1200\" spc=\"0\" strike=\"noStrike\" sz=\"1400\" u=\"none\">"
+ "<a:solidFill>"
+ "<a:schemeClr val=\"tx1\">"
+ "<a:lumMod val=\"65000\"/>"
+ "<a:lumOff val=\"35000\"/>"
+ "</a:schemeClr>"
+ "</a:solidFill>"
+ "<a:latin typeface=\"+mn-lt\"/>"
+ "<a:ea typeface=\"+mn-ea\"/>"
+ "<a:cs typeface=\"+mn-cs\"/>"
+ "</a:defRPr>"
+ "</a:pPr>"
+ "<a:r>"
+ "<a:rPr lang=\"en-PH\"/>"
+ "<a:t>Findings</a:t>"
+ "</a:r>"
+ "<a:r>"
+ "<a:rPr baseline=\"0\" lang=\"en-PH\"/>"
+ "<a:t> Distribution</a:t>"
+ "</a:r>"
+ "<a:endParaRPr lang=\"en-PH\"/>"
+ "</a:p>"
+ "</c:rich>"
+ "</c:tx>"
+ "<c:overlay val=\"0\"/>"
+ "<c:spPr>"
+ "<a:noFill/>"
+ "<a:ln>"
+ "<a:noFill/>"
+ "</a:ln>"
+ "<a:effectLst/>"
+ "</c:spPr>"
+ "<c:txPr>"
+ "<a:bodyPr anchor=\"ctr\" anchorCtr=\"1\" rot=\"0\" spcFirstLastPara=\"1\" vert=\"horz\" vertOverflow=\"ellipsis\" wrap=\"square\"/>"
+ "<a:lstStyle/>"
+ "<a:p>"
+ "<a:pPr>"
+ "<a:defRPr b=\"0\" baseline=\"0\" i=\"0\" kern=\"1200\" spc=\"0\" strike=\"noStrike\" sz=\"1400\" u=\"none\">"
+ "<a:solidFill>"
+ "<a:schemeClr val=\"tx1\">"
+ "<a:lumMod val=\"65000\"/>"
+ "<a:lumOff val=\"35000\"/>"
+ "</a:schemeClr>"
+ "</a:solidFill>"
+ "<a:latin typeface=\"+mn-lt\"/>"
+ "<a:ea typeface=\"+mn-ea\"/>"
+ "<a:cs typeface=\"+mn-cs\"/>"
+ "</a:defRPr>"
+ "</a:pPr>"
+ "<a:endParaRPr lang=\"en-US\"/>"
+ "</a:p>"
+ "</c:txPr>"
+ "</c:title>"
+ "<c:autoTitleDeleted val=\"0\"/>"
+ "<c:plotArea>"
+ "<c:layout>"
+ "<c:manualLayout>"
+ "<c:layoutTarget val=\"inner\"/>"
+ "<c:xMode val=\"edge\"/>"
+ "<c:yMode val=\"edge\"/>"
+ "<c:x val=\"0.1189951815724527\"/>"
+ "<c:y val=\"0.14718253968253969\"/>"
+ "<c:w val=\"0.84766079613182699\"/>"
+ "<c:h val=\"0.66998656417947755\"/>"
+ "</c:manualLayout>"
+ "</c:layout>"
+ "<c:barChart>"
+ "<c:barDir val=\"bar\"/>"
+ "<c:grouping val=\"stacked\"/>"
+ "<c:varyColors val=\"0\"/>"
+ "<c:ser>"
+ "<c:idx val=\"0\"/>"
+ "<c:order val=\"0\"/>"
+ "<c:tx>"
+ "<c:strRef>"
+ "<c:f>Sheet1!$B$1</c:f>"
+ "<c:strCache>"
+ "<c:ptCount val=\"1\"/>"
+ "<c:pt idx=\"0\">"
+ "<c:v>Critical</c:v>"
+ "</c:pt>"
+ "</c:strCache>"
+ "</c:strRef>"
+ "</c:tx>"
+ "<c:spPr>"
+ "<a:solidFill>"
+ "<a:srgbClr val=\"C00000\"/>"
+ "</a:solidFill>"
+ "<a:ln>"
+ "<a:noFill/>"
+ "</a:ln>"
+ "<a:effectLst/>"
+ "</c:spPr>"
+ "<c:invertIfNegative val=\"0\"/>"
+ "<c:cat>"
+ "<c:strRef>"
+ "<c:f>Sheet1!$A$2:$A$3</c:f>"
+ "<c:strCache>"
+ "<c:ptCount val=\"2\"/>"
+ "<c:pt idx=\"0\">"
+ "<c:v>Application</c:v>"
+ "</c:pt>"
+ "<c:pt idx=\"1\">"
+ "<c:v>Internal</c:v>"
+ "</c:pt>"
+ "</c:strCache>"
+ "</c:strRef>"
+ "</c:cat>"
+ "<c:val>"
+ "<c:numRef>"
+ "<c:f>Sheet1!$B$2:$B$3</c:f>"
+ "<c:numCache>"
+ "<c:formatCode>General</c:formatCode>"
+ "<c:ptCount val=\"2\"/>"
+ "<c:pt idx=\"0\">"
+ "<c:v>0</c:v>"
+ "</c:pt>"
+ "<c:pt idx=\"1\">"
+ "<c:v>0</c:v>"
+ "</c:pt>"
+ "</c:numCache>"
+ "</c:numRef>"
+ "</c:val>"
+ "<c:extLst>"
+ "<c:ext uri=\"{C3380CC4-5D6E-409C-BE32-E72D297353CC}\">"
+ "<c16:uniqueId val=\"{00000000-D670-7940-B18B-222508D5F4C1}\"/>"
+ "</c:ext>"
+ "</c:extLst>"
+ "</c:ser>"
+ "<c:ser>"
+ "<c:idx val=\"1\"/>"
+ "<c:order val=\"1\"/>"
+ "<c:tx>"
+ "<c:strRef>"
+ "<c:f>Sheet1!$C$1</c:f>"
+ "<c:strCache>"
+ "<c:ptCount val=\"1\"/>"
+ "<c:pt idx=\"0\">"
+ "<c:v>High</c:v>"
+ "</c:pt>"
+ "</c:strCache>"
+ "</c:strRef>"
+ "</c:tx>"
+ "<c:spPr>"
+ "<a:solidFill>"
+ "<a:srgbClr val=\"FF0000\"/>"
+ "</a:solidFill>"
+ "<a:ln>"
+ "<a:noFill/>"
+ "</a:ln>"
+ "<a:effectLst/>"
+ "</c:spPr>"
+ "<c:invertIfNegative val=\"0\"/>"
+ "<c:cat>"
+ "<c:strRef>"
+ "<c:f>Sheet1!$A$2:$A$3</c:f>"
+ "<c:strCache>"
+ "<c:ptCount val=\"2\"/>"
+ "<c:pt idx=\"0\">"
+ "<c:v>Application</c:v>"
+ "</c:pt>"
+ "<c:pt idx=\"1\">"
+ "<c:v>Internal</c:v>"
+ "</c:pt>"
+ "</c:strCache>"
+ "</c:strRef>"
+ "</c:cat>"
+ "<c:val>"
+ "<c:numRef>"
+ "<c:f>Sheet1!$C$2:$C$3</c:f>"
+ "<c:numCache>"
+ "<c:formatCode>General</c:formatCode>"
+ "<c:ptCount val=\"2\"/>"
+ "<c:pt idx=\"0\">"
+ "<c:v>0</c:v>"
+ "</c:pt>"
+ "<c:pt idx=\"1\">"
+ "<c:v>5</c:v>"
+ "</c:pt>"
+ "</c:numCache>"
+ "</c:numRef>"
+ "</c:val>"
+ "<c:extLst>"
+ "<c:ext uri=\"{C3380CC4-5D6E-409C-BE32-E72D297353CC}\">"
+ "<c16:uniqueId val=\"{00000001-D670-7940-B18B-222508D5F4C1}\"/>"
+ "</c:ext>"
+ "</c:extLst>"
+ "</c:ser>"
+ "<c:ser>"
+ "<c:idx val=\"2\"/>"
+ "<c:order val=\"2\"/>"
+ "<c:tx>"
+ "<c:strRef>"
+ "<c:f>Sheet1!$D$1</c:f>"
+ "<c:strCache>"
+ "<c:ptCount val=\"1\"/>"
+ "<c:pt idx=\"0\">"
+ "<c:v>Medium</c:v>"
+ "</c:pt>"
+ "</c:strCache>"
+ "</c:strRef>"
+ "</c:tx>"
+ "<c:spPr>"
+ "<a:solidFill>"
+ "<a:srgbClr val=\"FFC000\"/>"
+ "</a:solidFill>"
+ "<a:ln>"
+ "<a:noFill/>"
+ "</a:ln>"
+ "<a:effectLst/>"
+ "</c:spPr>"
+ "<c:invertIfNegative val=\"0\"/>"
+ "<c:dPt>"
+ "<c:idx val=\"0\"/>"
+ "<c:invertIfNegative val=\"0\"/>"
+ "<c:bubble3D val=\"0\"/>"
+ "<c:spPr>"
+ "<a:solidFill>"
+ "<a:srgbClr val=\"FFC000\"/>"
+ "</a:solidFill>"
+ "<a:ln>"
+ "<a:noFill/>"
+ "</a:ln>"
+ "<a:effectLst/>"
+ "</c:spPr>"
+ "<c:extLst>"
+ "<c:ext uri=\"{C3380CC4-5D6E-409C-BE32-E72D297353CC}\">"
+ "<c16:uniqueId val=\"{00000003-D670-7940-B18B-222508D5F4C1}\"/>"
+ "</c:ext>"
+ "</c:extLst>"
+ "</c:dPt>"
+ "<c:cat>"
+ "<c:strRef>"
+ "<c:f>Sheet1!$A$2:$A$3</c:f>"
+ "<c:strCache>"
+ "<c:ptCount val=\"2\"/>"
+ "<c:pt idx=\"0\">"
+ "<c:v>Application</c:v>"
+ "</c:pt>"
+ "<c:pt idx=\"1\">"
+ "<c:v>Internal</c:v>"
+ "</c:pt>"
+ "</c:strCache>"
+ "</c:strRef>"
+ "</c:cat>"
+ "<c:val>"
+ "<c:numRef>"
+ "<c:f>Sheet1!$D$2:$D$3</c:f>"
+ "<c:numCache>"
+ "<c:formatCode>General</c:formatCode>"
+ "<c:ptCount val=\"2\"/>"
+ "<c:pt idx=\"0\">"
+ "<c:v>1</c:v>"
+ "</c:pt>"
+ "<c:pt idx=\"1\">"
+ "<c:v>5</c:v>"
+ "</c:pt>"
+ "</c:numCache>"
+ "</c:numRef>"
+ "</c:val>"
+ "<c:extLst>"
+ "<c:ext uri=\"{C3380CC4-5D6E-409C-BE32-E72D297353CC}\">"
+ "<c16:uniqueId val=\"{00000004-D670-7940-B18B-222508D5F4C1}\"/>"
+ "</c:ext>"
+ "</c:extLst>"
+ "</c:ser>"
+ "<c:ser>"
+ "<c:idx val=\"3\"/>"
+ "<c:order val=\"3\"/>"
+ "<c:tx>"
+ "<c:strRef>"
+ "<c:f>Sheet1!$E$1</c:f>"
+ "<c:strCache>"
+ "<c:ptCount val=\"1\"/>"
+ "<c:pt idx=\"0\">"
+ "<c:v>Low</c:v>"
+ "</c:pt>"
+ "</c:strCache>"
+ "</c:strRef>"
+ "</c:tx>"
+ "<c:spPr>"
+ "<a:solidFill>"
+ "<a:srgbClr val=\"0070C0\"/>"
+ "</a:solidFill>"
+ "<a:ln>"
+ "<a:noFill/>"
+ "</a:ln>"
+ "<a:effectLst/>"
+ "</c:spPr>"
+ "<c:invertIfNegative val=\"0\"/>"
+ "<c:cat>"
+ "<c:strRef>"
+ "<c:f>Sheet1!$A$2:$A$3</c:f>"
+ "<c:strCache>"
+ "<c:ptCount val=\"2\"/>"
+ "<c:pt idx=\"0\">"
+ "<c:v>Application</c:v>"
+ "</c:pt>"
+ "<c:pt idx=\"1\">"
+ "<c:v>Internal</c:v>"
+ "</c:pt>"
+ "</c:strCache>"
+ "</c:strRef>"
+ "</c:cat>"
+ "<c:val>"
+ "<c:numRef>"
+ "<c:f>Sheet1!$E$2:$E$3</c:f>"
+ "<c:numCache>"
+ "<c:formatCode>General</c:formatCode>"
+ "<c:ptCount val=\"2\"/>"
+ "<c:pt idx=\"0\">"
+ "<c:v>2</c:v>"
+ "</c:pt>"
+ "<c:pt idx=\"1\">"
+ "<c:v>4</c:v>"
+ "</c:pt>"
+ "</c:numCache>"
+ "</c:numRef>"
+ "</c:val>"
+ "<c:extLst>"
+ "<c:ext uri=\"{C3380CC4-5D6E-409C-BE32-E72D297353CC}\">"
+ "<c16:uniqueId val=\"{00000005-D670-7940-B18B-222508D5F4C1}\"/>"
+ "</c:ext>"
+ "</c:extLst>"
+ "</c:ser>"
+ "<c:ser>"
+ "<c:idx val=\"4\"/>"
+ "<c:order val=\"4\"/>"
+ "<c:tx>"
+ "<c:strRef>"
+ "<c:f>Sheet1!$F$1</c:f>"
+ "<c:strCache>"
+ "<c:ptCount val=\"1\"/>"
+ "<c:pt idx=\"0\">"
+ "<c:v>Info</c:v>"
+ "</c:pt>"
+ "</c:strCache>"
+ "</c:strRef>"
+ "</c:tx>"
+ "<c:spPr>"
+ "<a:solidFill>"
+ "<a:schemeClr val=\"bg1\">"
+ "<a:lumMod val=\"65000\"/>"
+ "</a:schemeClr>"
+ "</a:solidFill>"
+ "<a:ln>"
+ "<a:noFill/>"
+ "</a:ln>"
+ "<a:effectLst/>"
+ "</c:spPr>"
+ "<c:invertIfNegative val=\"0\"/>"
+ "<c:cat>"
+ "<c:strRef>"
+ "<c:f>Sheet1!$A$2:$A$3</c:f>"
+ "<c:strCache>"
+ "<c:ptCount val=\"2\"/>"
+ "<c:pt idx=\"0\">"
+ "<c:v>Application</c:v>"
+ "</c:pt>"
+ "<c:pt idx=\"1\">"
+ "<c:v>Internal</c:v>"
+ "</c:pt>"
+ "</c:strCache>"
+ "</c:strRef>"
+ "</c:cat>"
+ "<c:val>"
+ "<c:numRef>"
+ "<c:f>Sheet1!$F$2:$F$3</c:f>"
+ "<c:numCache>"
+ "<c:formatCode>General</c:formatCode>"
+ "<c:ptCount val=\"2\"/>"
+ "<c:pt idx=\"0\">"
+ "<c:v>1</c:v>"
+ "</c:pt>"
+ "<c:pt idx=\"1\">"
+ "<c:v>4</c:v>"
+ "</c:pt>"
+ "</c:numCache>"
+ "</c:numRef>"
+ "</c:val>"
+ "<c:extLst>"
+ "<c:ext uri=\"{C3380CC4-5D6E-409C-BE32-E72D297353CC}\">"
+ "<c16:uniqueId val=\"{00000006-D670-7940-B18B-222508D5F4C1}\"/>"
+ "</c:ext>"
+ "</c:extLst>"
+ "</c:ser>"
+ "<c:dLbls>"
+ "<c:showLegendKey val=\"0\"/>"
+ "<c:showVal val=\"0\"/>"
+ "<c:showCatName val=\"0\"/>"
+ "<c:showSerName val=\"0\"/>"
+ "<c:showPercent val=\"0\"/>"
+ "<c:showBubbleSize val=\"0\"/>"
+ "</c:dLbls>"
+ "<c:gapWidth val=\"150\"/>"
+ "<c:overlap val=\"100\"/>"
+ "<c:axId val=\"300661887\"/>"
+ "<c:axId val=\"162458799\"/>"
+ "</c:barChart>"
+ "<c:catAx>"
+ "<c:axId val=\"300661887\"/>"
+ "<c:scaling>"
+ "<c:orientation val=\"minMax\"/>"
+ "</c:scaling>"
+ "<c:delete val=\"0\"/>"
+ "<c:axPos val=\"l\"/>"
+ "<c:numFmt formatCode=\"General\" sourceLinked=\"1\"/>"
+ "<c:majorTickMark val=\"none\"/>"
+ "<c:minorTickMark val=\"none\"/>"
+ "<c:tickLblPos val=\"nextTo\"/>"
+ "<c:spPr>"
+ "<a:noFill/>"
+ "<a:ln algn=\"ctr\" cap=\"flat\" cmpd=\"sng\" w=\"9525\">"
+ "<a:solidFill>"
+ "<a:schemeClr val=\"tx1\">"
+ "<a:lumMod val=\"15000\"/>"
+ "<a:lumOff val=\"85000\"/>"
+ "</a:schemeClr>"
+ "</a:solidFill>"
+ "<a:round/>"
+ "</a:ln>"
+ "<a:effectLst/>"
+ "</c:spPr>"
+ "<c:txPr>"
+ "<a:bodyPr anchor=\"ctr\" anchorCtr=\"1\" rot=\"-60000000\" spcFirstLastPara=\"1\" vert=\"horz\" vertOverflow=\"ellipsis\" wrap=\"square\"/>"
+ "<a:lstStyle/>"
+ "<a:p>"
+ "<a:pPr>"
+ "<a:defRPr b=\"0\" baseline=\"0\" i=\"0\" kern=\"1200\" strike=\"noStrike\" sz=\"900\" u=\"none\">"
+ "<a:solidFill>"
+ "<a:schemeClr val=\"tx1\">"
+ "<a:lumMod val=\"65000\"/>"
+ "<a:lumOff val=\"35000\"/>"
+ "</a:schemeClr>"
+ "</a:solidFill>"
+ "<a:latin typeface=\"+mn-lt\"/>"
+ "<a:ea typeface=\"+mn-ea\"/>"
+ "<a:cs typeface=\"+mn-cs\"/>"
+ "</a:defRPr>"
+ "</a:pPr>"
+ "<a:endParaRPr lang=\"en-US\"/>"
+ "</a:p>"
+ "</c:txPr>"
+ "<c:crossAx val=\"162458799\"/>"
+ "<c:crosses val=\"autoZero\"/>"
+ "<c:auto val=\"1\"/>"
+ "<c:lblAlgn val=\"ctr\"/>"
+ "<c:lblOffset val=\"100\"/>"
+ "<c:noMultiLvlLbl val=\"0\"/>"
+ "</c:catAx>"
+ "<c:valAx>"
+ "<c:axId val=\"162458799\"/>"
+ "<c:scaling>"
+ "<c:orientation val=\"minMax\"/>"
+ "<c:max val=\"20\"/>"
+ "</c:scaling>"
+ "<c:delete val=\"0\"/>"
+ "<c:axPos val=\"b\"/>"
+ "<c:majorGridlines>"
+ "<c:spPr>"
+ "<a:ln algn=\"ctr\" cap=\"flat\" cmpd=\"sng\" w=\"9525\">"
+ "<a:solidFill>"
+ "<a:schemeClr val=\"tx1\">"
+ "<a:lumMod val=\"15000\"/>"
+ "<a:lumOff val=\"85000\"/>"
+ "</a:schemeClr>"
+ "</a:solidFill>"
+ "<a:round/>"
+ "</a:ln>"
+ "<a:effectLst/>"
+ "</c:spPr>"
+ "</c:majorGridlines>"
+ "<c:numFmt formatCode=\"General\" sourceLinked=\"1\"/>"
+ "<c:majorTickMark val=\"none\"/>"
+ "<c:minorTickMark val=\"none\"/>"
+ "<c:tickLblPos val=\"nextTo\"/>"
+ "<c:spPr>"
+ "<a:noFill/>"
+ "<a:ln>"
+ "<a:noFill/>"
+ "</a:ln>"
+ "<a:effectLst/>"
+ "</c:spPr>"
+ "<c:txPr>"
+ "<a:bodyPr anchor=\"ctr\" anchorCtr=\"1\" rot=\"-60000000\" spcFirstLastPara=\"1\" vert=\"horz\" vertOverflow=\"ellipsis\" wrap=\"square\"/>"
+ "<a:lstStyle/>"
+ "<a:p>"
+ "<a:pPr>"
+ "<a:defRPr b=\"0\" baseline=\"0\" i=\"0\" kern=\"1200\" strike=\"noStrike\" sz=\"900\" u=\"none\">"
+ "<a:solidFill>"
+ "<a:schemeClr val=\"tx1\">"
+ "<a:lumMod val=\"65000\"/>"
+ "<a:lumOff val=\"35000\"/>"
+ "</a:schemeClr>"
+ "</a:solidFill>"
+ "<a:latin typeface=\"+mn-lt\"/>"
+ "<a:ea typeface=\"+mn-ea\"/>"
+ "<a:cs typeface=\"+mn-cs\"/>"
+ "</a:defRPr>"
+ "</a:pPr>"
+ "<a:endParaRPr lang=\"en-US\"/>"
+ "</a:p>"
+ "</c:txPr>"
+ "<c:crossAx val=\"300661887\"/>"
+ "<c:crosses val=\"autoZero\"/>"
+ "<c:crossBetween val=\"between\"/>"
+ "<c:majorUnit val=\"2\"/>"
+ "<c:minorUnit val=\"2\"/>"
+ "</c:valAx>"
+ "<c:spPr>"
+ "<a:noFill/>"
+ "<a:ln>"
+ "<a:noFill/>"
+ "</a:ln>"
+ "<a:effectLst/>"
+ "</c:spPr>"
+ "</c:plotArea>"
+ "<c:legend>"
+ "<c:legendPos val=\"b\"/>"
+ "<c:overlay val=\"0\"/>"
+ "<c:spPr>"
+ "<a:noFill/>"
+ "<a:ln>"
+ "<a:noFill/>"
+ "</a:ln>"
+ "<a:effectLst/>"
+ "</c:spPr>"
+ "<c:txPr>"
+ "<a:bodyPr anchor=\"ctr\" anchorCtr=\"1\" rot=\"0\" spcFirstLastPara=\"1\" vert=\"horz\" vertOverflow=\"ellipsis\" wrap=\"square\"/>"
+ "<a:lstStyle/>"
+ "<a:p>"
+ "<a:pPr>"
+ "<a:defRPr b=\"0\" baseline=\"0\" i=\"0\" kern=\"1200\" strike=\"noStrike\" sz=\"900\" u=\"none\">"
+ "<a:solidFill>"
+ "<a:schemeClr val=\"tx1\">"
+ "<a:lumMod val=\"65000\"/>"
+ "<a:lumOff val=\"35000\"/>"
+ "</a:schemeClr>"
+ "</a:solidFill>"
+ "<a:latin typeface=\"+mn-lt\"/>"
+ "<a:ea typeface=\"+mn-ea\"/>"
+ "<a:cs typeface=\"+mn-cs\"/>"
+ "</a:defRPr>"
+ "</a:pPr>"
+ "<a:endParaRPr lang=\"en-US\"/>"
+ "</a:p>"
+ "</c:txPr>"
+ "</c:legend>"
+ "<c:plotVisOnly val=\"1\"/>"
+ "<c:dispBlanksAs val=\"gap\"/>"
+ "<c:extLst>"
+ "<c:ext uri=\"{56B9EC1D-385E-4148-901F-78D8002777C0}\">"
+ "<c16r3:dataDisplayOptions16>"
+ "<c16r3:dispNaAsBlank val=\"1\"/>"
+ "</c16r3:dataDisplayOptions16>"
+ "</c:ext>"
+ "</c:extLst>"
+ "<c:showDLblsOverMax val=\"0\"/>"
+ "</c:chart>"
+ "<c:spPr>"
+ "<a:solidFill>"
+ "<a:schemeClr val=\"bg1\"/>"
+ "</a:solidFill>"
+ "<a:ln algn=\"ctr\" cap=\"flat\" cmpd=\"sng\" w=\"9525\">"
+ "<a:solidFill>"
+ "<a:schemeClr val=\"tx1\">"
+ "<a:lumMod val=\"15000\"/>"
+ "<a:lumOff val=\"85000\"/>"
+ "</a:schemeClr>"
+ "</a:solidFill>"
+ "<a:round/>"
+ "</a:ln>"
+ "<a:effectLst/>"
+ "</c:spPr>"
+ "<c:txPr>"
+ "<a:bodyPr/>"
+ "<a:lstStyle/>"
+ "<a:p>"
+ "<a:pPr>"
+ "<a:defRPr/>"
+ "</a:pPr>"
+ "<a:endParaRPr lang=\"en-US\"/>"
+ "</a:p>"
+ "</c:txPr>"
+ "<c:externalData r:id=\"rId3\">"
+ "<c:autoUpdate val=\"0\"/>"
+ "</c:externalData>"
+ "</c:chartSpace>";
javax.xml.bind.JAXBElement<CTChartSpace> obj = (javax.xml.bind.JAXBElement<CTChartSpace>)XmlUtils.unmarshalString(openXML);
CTChartSpace chartspace = (CTChartSpace)XmlUtils.unwrap(obj);
Chart chartPart = new org.docx4j.openpackaging.parts.DrawingML.Chart(new PartName("/word/charts/chart1.xml"));
chartPart.setJaxbElement(chartspace);
Relationship rel = wordMLPackage.addTargetPart(chartPart);
String chartRel = "<w:p w14:paraId=\"2F6BFB4B\" w14:textId=\"37C72A74\" xmlns:a=\"http://schemas.openxmlformats.org/drawingml/2006/main\" xmlns:r=\"http://schemas.openxmlformats.org/officeDocument/2006/relationships\" xmlns:c=\"http://schemas.openxmlformats.org/drawingml/2006/chart\" xmlns:w=\"http://schemas.openxmlformats.org/wordprocessingml/2006/main\" xmlns:wp=\"http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing\" xmlns:w14=\"http://schemas.microsoft.com/office/word/2010/wordml\">"
+ "<w:r>"
+ "<w:rPr>"
+ "<w:rFonts w:asciiTheme=\"minorHAnsi\" w:hAnsiTheme=\"minorHAnsi\"/>"
+ "<w:noProof/>"
+ "</w:rPr>"
+ "<w:lastRenderedPageBreak/>"
+ "<w:drawing>"
+ "<wp:inline distB=\"0\" distL=\"0\" distR=\"0\" distT=\"0\">"
+ "<wp:extent cx=\"5943600\" cy=\"2288280\"/>"
+ "<wp:effectExtent b=\"10795\" l=\"0\" r=\"12700\" t=\"0\"/>"
+ "<wp:docPr id=\"45\" name=\"Chart 45\"/>"
+ "<wp:cNvGraphicFramePr/>"
+ "<a:graphic>"
+ "<a:graphicData uri=\"http://schemas.openxmlformats.org/drawingml/2006/chart\">"
+ "<c:chart r:id=\"%s\"/>"
+ "</a:graphicData>"
+ "</a:graphic>"
+ "</wp:inline>"
+ "</w:drawing>"
+ "</w:r>"
+ "</w:p>";
wordMLPackage.getMainDocumentPart().addParagraph(String.format(chartRel, rel.getId()));