Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A chart part with </mc:AlternateContent> can not load #604

Open
solarwise opened this issue Jan 17, 2025 · 3 comments
Open

A chart part with </mc:AlternateContent> can not load #604

solarwise opened this issue Jan 17, 2025 · 3 comments

Comments

@solarwise
Copy link

<c:chartSpace xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart"
xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"
xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships"
xmlns:c16r2="http://schemas.microsoft.com/office/drawing/2015/06/chart">
<c:date1904 val="0"/>
<c:lang val="zh-CN"/>
<c:roundedCorners val="0"/>
<mc:AlternateContent xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">
<mc:Choice Requires="c14" xmlns:c14="http://schemas.microsoft.com/office/drawing/2007/8/2/chart">
<c14:style val="102"/>
</mc:Choice>
mc:Fallback
<c:style val="2"/>
</mc:Fallback>
</mc:AlternateContent>
<c:clrMapOvr bg1="lt1" tx1="dk1" bg2="lt2" tx2="dk2" accent1="accent1" accent2="accent2"
accent3="accent3" accent4="accent4" accent5="accent5" accent6="accent6" hlink="hlink"
folHlink="folHlink"/>
<c:chart>
<c:title>
<c:tx>
<c:rich>
<a:bodyPr rot="0" spcFirstLastPara="1" vertOverflow="ellipsis" vert="horz" wrap="square"
anchor="ctr" anchorCtr="1"/>
<a:lstStyle/>
<a:p>
<a:pPr>
<a:defRPr lang="zh-CN" sz="1400" b="0" i="0" u="none" strike="noStrike"
kern="1200" spc="0" baseline="0">
<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="zh-CN" altLang="en-US" sz="1000">
<a:solidFill>
<a:schemeClr val="accent2"/>
</a:solidFill>
</a:rPr>
<a:t>*样本总体为认为有招聘计划的四人</a:t>
</a:r>
</a:p>
</c:rich>
</c:tx>
<c:layout>
<c:manualLayout>
<c:xMode val="edge"/>
<c:yMode val="edge"/>
<c:x val="0.13499496475327299"/>
<c:y val="3.3444816053511697E-2"/>
</c:manualLayout>
</c:layout>
<c:overlay val="0"/>
<c:spPr>
<a:noFill/>
<a:ln>
<a:noFill/>
</a:ln>
<a:effectLst/>
</c:spPr>
</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.23181046855547899"/>
<c:y val="0.21181716833890701"/>
<c:w val="0.59680202361411805"/>
<c:h val="0.660673812094558"/>
</c:manualLayout>
</c:layout>
<c:pieChart>
<c:varyColors val="1"/>
<c:ser>
<c:idx val="0"/>
<c:order val="0"/>
<c:dPt>
<c:idx val="0"/>
<c:bubble3D val="0"/>
<c:spPr>
<a:solidFill>
<a:schemeClr val="accent1"/>
</a:solidFill>
<a:ln w="19050">
<a:solidFill>
<a:schemeClr val="lt1"/>
</a:solidFill>
</a:ln>
<a:effectLst/>
</c:spPr>
<c:extLst>
<c:ext uri="{C3380CC4-5D6E-409C-BE32-E72D297353CC}"
xmlns:c16="http://schemas.microsoft.com/office/drawing/2014/chart">
<c16:uniqueId val="{00000001-441D-44E0-A3D3-74DC45549F61}"/>
</c:ext>
</c:extLst>
</c:dPt>
<c:dPt>
<c:idx val="1"/>
<c:bubble3D val="0"/>
<c:spPr>
<a:solidFill>
<a:schemeClr val="accent2"/>
</a:solidFill>
<a:ln w="19050">
<a:solidFill>
<a:schemeClr val="lt1"/>
</a:solidFill>
</a:ln>
<a:effectLst/>
</c:spPr>
<c:extLst>
<c:ext uri="{C3380CC4-5D6E-409C-BE32-E72D297353CC}"
xmlns:c16="http://schemas.microsoft.com/office/drawing/2014/chart">
<c16:uniqueId val="{00000003-441D-44E0-A3D3-74DC45549F61}"/>
</c:ext>
</c:extLst>
</c:dPt>
<c:dPt>
<c:idx val="2"/>
<c:bubble3D val="0"/>
<c:spPr>
<a:solidFill>
<a:schemeClr val="accent3"/>
</a:solidFill>
<a:ln w="19050">
<a:solidFill>
<a:schemeClr val="lt1"/>
</a:solidFill>
</a:ln>
<a:effectLst/>
</c:spPr>
<c:extLst>
<c:ext uri="{C3380CC4-5D6E-409C-BE32-E72D297353CC}"
xmlns:c16="http://schemas.microsoft.com/office/drawing/2014/chart">
<c16:uniqueId val="{00000005-441D-44E0-A3D3-74DC45549F61}"/>
</c:ext>
</c:extLst>
</c:dPt>
<c:dPt>
<c:idx val="3"/>
<c:bubble3D val="0"/>
<c:spPr>
<a:solidFill>
<a:schemeClr val="accent4"/>
</a:solidFill>
<a:ln w="19050">
<a:solidFill>
<a:schemeClr val="lt1"/>
</a:solidFill>
</a:ln>
<a:effectLst/>
</c:spPr>
<c:extLst>
<c:ext uri="{C3380CC4-5D6E-409C-BE32-E72D297353CC}"
xmlns:c16="http://schemas.microsoft.com/office/drawing/2014/chart">
<c16:uniqueId val="{00000007-441D-44E0-A3D3-74DC45549F61}"/>
</c:ext>
</c:extLst>
</c:dPt>
<c:dLbls>
<c:spPr>
<a:noFill/>
<a:ln>
<a:noFill/>
</a:ln>
<a:effectLst/>
</c:spPr>
<c:txPr>
<a:bodyPr rot="0" spcFirstLastPara="1" vertOverflow="ellipsis" vert="horz"
wrap="square" lIns="38100" tIns="19050" rIns="38100" bIns="19050"
anchor="ctr" anchorCtr="1">
<a:spAutoFit/>
</a:bodyPr>
<a:lstStyle/>
<a:p>
<a:pPr>
<a:defRPr lang="zh-CN" sz="900" b="0" i="0" u="none" strike="noStrike"
kern="1200" baseline="0">
<a:solidFill>
<a:schemeClr val="tx1">
<a:lumMod val="75000"/>
<a:lumOff val="25000"/>
</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="zh-CN"/>
</a:p>
</c:txPr>
<c:dLblPos val="bestFit"/>
<c:showLegendKey val="0"/>
<c:showVal val="1"/>
<c:showCatName val="0"/>
<c:showSerName val="0"/>
<c:showPercent val="0"/>
<c:showBubbleSize val="0"/>
<c:showLeaderLines val="1"/>
<c:leaderLines>
<c:spPr>
<a:ln w="9525" cap="flat" cmpd="sng" algn="ctr">
<a:solidFill>
<a:schemeClr val="tx1">
<a:lumMod val="35000"/>
<a:lumOff val="65000"/>
</a:schemeClr>
</a:solidFill>
<a:prstDash val="solid"/>
<a:round/>
</a:ln>
<a:effectLst/>
</c:spPr>
</c:leaderLines>
<c:extLst>
<c:ext uri="{CE6537A1-D6FC-4f65-9D91-7224C49458BB}"
xmlns:c15="http://schemas.microsoft.com/office/drawing/2012/chart"/>
</c:extLst>
</c:dLbls>
<c:cat>
<c:strRef>
<c:f>Sheet1!$A$2:$A$5</c:f>
<c:strCache>
<c:ptCount val="4"/>
<c:pt idx="0">
<c:v>非常完善</c:v>
</c:pt>
<c:pt idx="1">
<c:v>基本完善</c:v>
</c:pt>
<c:pt idx="2">
<c:v>不完善</c:v>
</c:pt>
<c:pt idx="3">
<c:v>不了解</c:v>
</c:pt>
</c:strCache>
</c:strRef>
</c:cat>
<c:val>
<c:numRef>
<c:f>Sheet1!$B$2:$B$5</c:f>
<c:numCache>
<c:formatCode>0%</c:formatCode>
<c:ptCount val="4"/>
<c:pt idx="0" formatCode="General">
<c:v>0</c:v>
</c:pt>
<c:pt idx="1">
<c:v>0.25</c:v>
</c:pt>
<c:pt idx="2">
<c:v>0.5</c:v>
</c:pt>
<c:pt idx="3">
<c:v>0.25</c:v>
</c:pt>
</c:numCache>
</c:numRef>
</c:val>
<c:extLst>
<c:ext uri="{02D57815-91ED-43cb-92C2-25804820EDAC}"
xmlns:c15="http://schemas.microsoft.com/office/drawing/2012/chart">
c15:filteredSeriesTitle
c15:tx
<c:strRef>
<c:extLst>
<c:ext uri="{02D57815-91ED-43cb-92C2-25804820EDAC}">
c15:formulaRef
c15:sqrefSheet1!#REF!</c15:sqref>
</c15:formulaRef>
</c:ext>
</c:extLst>
<c:strCache>
<c:ptCount val="1"/>
<c:pt idx="0">
<c:v>#REF!</c:v>
</c:pt>
</c:strCache>
</c:strRef>
</c15:tx>
</c15:filteredSeriesTitle>
</c:ext>
<c:ext uri="{C3380CC4-5D6E-409C-BE32-E72D297353CC}"
xmlns:c16="http://schemas.microsoft.com/office/drawing/2014/chart">
<c16:uniqueId val="{00000008-441D-44E0-A3D3-74DC45549F61}"/>
</c:ext>
</c:extLst>
</c:ser>
<c:dLbls>
<c:showLegendKey val="0"/>
<c:showVal val="1"/>
<c:showCatName val="0"/>
<c:showSerName val="0"/>
<c:showPercent val="0"/>
<c:showBubbleSize val="0"/>
<c:showLeaderLines val="1"/>
</c:dLbls>
<c:firstSliceAng val="0"/>
</c:pieChart>
<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 rot="0" spcFirstLastPara="1" vertOverflow="ellipsis" vert="horz" wrap="square"
anchor="ctr" anchorCtr="1"/>
<a:lstStyle/>
<a:p>
<a:pPr>
<a:defRPr lang="zh-CN" sz="900" b="0" i="0" u="none" strike="noStrike" kern="1200"
baseline="0">
<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="zh-CN"/>
</a:p>
</c:txPr>
</c:legend>
<c:plotVisOnly val="1"/>
<c:dispBlanksAs val="gap"/>
<c:showDLblsOverMax val="0"/>
<c:extLst>
<c:ext uri="{0b15fc19-7d7d-44ad-8c2d-2c3a37ce22c3}">

</c:ext>
</c:extLst>
</c:chart>
<c:spPr>
<a:solidFill>
<a:schemeClr val="bg1"/>
</a:solidFill>
<a:ln w="9525" cap="flat" cmpd="sng" algn="ctr">
<a:solidFill>
<a:schemeClr val="tx1">
<a:lumMod val="15000"/>
<a:lumOff val="85000"/>
</a:schemeClr>
</a:solidFill>
<a:prstDash val="solid"/>
<a:round/>
</a:ln>
<a:effectLst/>
</c:spPr>
<c:txPr>
<a:bodyPr/>
<a:lstStyle/>
<a:p>
<a:pPr>
<a:defRPr lang="zh-CN"/>
</a:pPr>
<a:endParaRPr lang="zh-CN"/>
</a:p>
</c:txPr>
<c:externalData r:id="rId2">
<c:autoUpdate val="0"/>
</c:externalData>
</c:chartSpace>

@plutext
Copy link
Owner

plutext commented Jan 17, 2025

Cannot load in docx4j or Word?

Please attach a complete sample docx file

@solarwise
Copy link
Author

Cannot load in docx4j or Word?

Please attach a complete sample docx file

row document can load in Word, when load in Docx4j,have a error message: org.xml.sax.SAXParseException;unexpected element (uri:"http://schemas.openxmlformats.org/markup-compatibility/2006"

then deepcopy chat to new document, new document can't open in word

row.docx

` // get row chart
Relationship relationshipByID = mainDocumentPart.getRelationshipsPart().getRelationshipByID(rowRefId);
Chart chart = (Chart) mainDocumentPart.getRelationshipsPart().getPart(relationshipByID);
if (chart == null) {
return null;
}

    //  copy chart
    Chart destChart = new Chart(null);
    String xml = chart.getXML();
    CTChartSpace o = (CTChartSpace) XmlUtils.unmarshalString(xml);
    destChart.setContents(o);`

@solarwise
Copy link
Author

But, save as xml, word can load new document。

mlPackage.save(new FileOutputStream("D:\\tmp\\debug\\newDoc.xml"),Docx4J.FLAG_SAVE_FLAT_XML);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants