style1.xml and color1.xml files not recognized by Excel for older charts
The issue involves style1.xml and color1.xml files being ignored by chart1.xml for style information, despite adherence to the valid schema as per the documentation at ECMA-376 and MS-OE376.
After converting to .xlsx, the chart defaults to style id=2 upon opening in Excel. All files are confirmed to be valid according to the schema, yet the resulting behavior is unexpected. What could be causing this issue?
In Office 360 Excel, In this scenario, I have a PieChart with 3 datapoints, and Color Scheme 3 a/c to the XML contents which all adhear to Schema definations perfectly. Yet When I open the xlsx file, Add more Datapoints, the colors of the datapoints are not Color Scheme 3, Instead they are the default datapoint colors you would get from <c:style id="2">. In this case, If I save the file and check its contents, the color1.xml and style1.xml are lost, and just chart1.xml is written, similar to olider excel version (2007).
Yet, If I create the exact chart setup in excel 360 save it, and check its xlsx contents, The only difference I see is spPr tags and txPr tags written in a redundant way, and no documentation is available as to why we need to write redudant style information chart1.xml for it to recognize style1.xml and color1.xml
Removing any small portions of these redundant spPr / txPr will cause the issue described above.
If there is any information on how exactly the redundant style information needs to be written for older charts for them to be able to recognize style1.xml and color1.xml, it would be greatly apprecieted.
Regards,
Revanth
Microsoft 365 and Office Open Specifications
-
Gabriel-N • 1,715 Reputation points • Microsoft External Staff • Moderator
2025-06-23T14:08:45.8033333+00:00 Thank you for posting your question in the Microsoft Q&A forum.
We kindly ask for your understanding, as there may be delays in both receiving responses and posting new threads due to the ongoing integration of the Answer and Q&A forums. During this transitional period, certain activities may not be reflected immediately. We sincerely appreciate your patience and continued engagement as we work to enhance the overall experience for all community members.
Additionally, we truly value the time you’ve taken to share the details of your situation. Please rest assured that your concerns are fully understood, and we are here to support you. Just to make sure I’m understanding correctly, from what you’ve described, it seems like you’re creating an .xlsx file by manually combining XML files into a ZIP archive. Is that right? If that’s correct, please keep in mind that this isn’t the usual way Excel files are built, so sometimes it can lead to things not working quite as expected.
We’ve tried to recreate the issue on our end to better understand what’s going on, but everything seems to be working fine in our environment so far.
To help us investigate further and provide more accurate support, could you kindly share the portion of your code or XML that includes the <spPr> and <txPr> tags written in the way you mentioned? This would greatly help us understand the structure and identify any potential issues.
Looking forward to hearing from you.
-
Revanth Kumar • 0 Reputation points
2025-06-23T15:36:54.2533333+00:00 Hello Gabriel,
Thank you for the swift reply. I would be happy to clarify this.
below is my chart1.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <c:chartSpace xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart" xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"> <c:lang val="en-In"/> <c:roundedCorners val="0"/> <c:chart> <c:title> <c:tx> <c:rich> <a:bodyPr vertOverflow="ellipsis" anchor="ctr"/> <a:p> <a:pPr> <a:defRPr> <a:latin typeface="Arial"/> <a:cs typeface="Arial"/> </a:defRPr> </a:pPr> <a:r> <a:rPr sz="1400" b="0" i="0"> <a:solidFill> <a:srgbClr val="595959"></a:srgbClr> </a:solidFill> </a:rPr> <a:t>Chart Title</a:t> </a:r> </a:p> </c:rich> </c:tx> <c:overlay val="0"/> </c:title> <c:autoTitleDeleted val="0"/> <c:plotArea> <c:pieChart> <c:varyColors val="1"/> <c:ser> <c:idx val="0"/> <c:order val="0"/> <c:tx> <c:v>Series1</c:v> </c:tx> <c:dPt> <c:idx val="0"/> <c:spPr> <a:solidFill> <a:srgbClr val="5EC795"> <a:alpha val="100000"/> </a:srgbClr> </a:solidFill> <a:ln> <a:solidFill> <a:srgbClr val="FFFFFF"></a:srgbClr> </a:solidFill> </a:ln> </c:spPr> </c:dPt> <c:dPt> <c:idx val="1"/> <c:spPr> <a:solidFill> <a:srgbClr val="CDB756"> <a:alpha val="100000"/> </a:srgbClr> </a:solidFill> <a:ln> <a:solidFill> <a:srgbClr val="FFFFFF"></a:srgbClr> </a:solidFill> </a:ln> </c:spPr> </c:dPt> <c:dPt> <c:idx val="2"/> <c:spPr> <a:solidFill> <a:srgbClr val="8EC0C1"> <a:alpha val="100000"/> </a:srgbClr> </a:solidFill> <a:ln> <a:solidFill> <a:srgbClr val="FFFFFF"></a:srgbClr> </a:solidFill> </a:ln> </c:spPr> </c:dPt> <c:val> <c:numRef> <c:f>('Sheet1'!$E$9:$E$11)</c:f> <c:numCache/> </c:numRef> </c:val> </c:ser> <c:dLbls> <c:txPr> <a:bodyPr vertOverflow="ellipsis" anchor="ctr" horzOverflow="overflow" anchorCtr="1"/> <a:p> <a:pPr> <a:defRPr sz="1200" b="0" i="0"> <a:solidFill> <a:srgbClr val="666666"></a:srgbClr> </a:solidFill> </a:defRPr> </a:pPr> <a:endParaRPr sz="1200" b="0" i="0"> <a:solidFill> <a:srgbClr val="666666"></a:srgbClr> </a:solidFill> </a:endParaRPr> </a:p> </c:txPr> <c:dLblPos val="ctr"/> <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:firstSliceAng val="0"/> </c:pieChart> <c:spPr> <a:noFill/> <a:ln> <a:noFill/> </a:ln> </c:spPr> </c:plotArea> <c:legend> <c:legendPos val="b"/> <c:overlay val="0"/> <c:txPr> <a:bodyPr/> <a:p> <a:pPr> <a:defRPr sz="900" b="0" i="0"> <a:solidFill> <a:srgbClr val="595959"></a:srgbClr> </a:solidFill> </a:defRPr> </a:pPr> </a:p> </c:txPr> </c:legend> <c:plotVisOnly val="1"/> </c:chart> <c:spPr> <a:solidFill> <a:srgbClr val="FFFFFF"> <a:alpha val="100000"/> </a:srgbClr> </a:solidFill> <a:ln> <a:solidFill> <a:srgbClr val="D9D9D9"></a:srgbClr> </a:solidFill> </a:ln> </c:spPr> <c:txPr> <a:bodyPr/> <a:p> <a:pPr> <a:defRPr> <a:latin typeface="Arial"/> <a:cs typeface="Arial"/> </a:defRPr> </a:pPr> </a:p> </c:txPr> </c:chartSpace>
This is my chart XML. If you can replace this, and attach the style1.xml and color1.xml ( for the color scheme 3, namely accent1, accent3, accent5 pattern), this chart1.xml doesnt recognize the style1.xml, and fallsback to style id=2 default colors. And this chart1.xml is compliant with Schema.
below is chart1.xml (written by excel)
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <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="en-US"/> <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:chart> <c:title> <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 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:endParaRPr lang="en-US"/> </a:p> </c:txPr> </c:title> <c:autoTitleDeleted val="0"/> <c:plotArea> <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="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="{00000001-B1FB-5846-8A93-5EA6DB3268B4}"/> </c:ext> </c:extLst> </c:dPt> <c:dPt> <c:idx val="1"/> <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="{00000003-B1FB-5846-8A93-5EA6DB3268B4}"/> </c:ext> </c:extLst> </c:dPt> <c:dPt> <c:idx val="2"/> <c:bubble3D val="0"/> <c:spPr> <a:solidFill> <a:schemeClr val="accent6"/> </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-B1FB-5846-8A93-5EA6DB3268B4}"/> </c:ext> </c:extLst> </c:dPt> <c:val> <c:numRef> <c:f>Sheet1!$E$9:$E$11</c:f> <c:numCache> <c:formatCode>General</c:formatCode> <c:ptCount val="3"/> <c:pt idx="0"> <c:v>1</c:v> </c:pt> <c:pt idx="1"> <c:v>2</c:v> </c:pt> <c:pt idx="2"> <c:v>3</c:v> </c:pt> </c:numCache> </c:numRef> </c:val> <c:extLst> <c:ext uri="{C3380CC4-5D6E-409C-BE32-E72D297353CC}" xmlns:c16="http://schemas.microsoft.com/office/drawing/2014/chart"> <c16:uniqueId val="{00000000-EA70-B64A-B9DC-61E2228E23DF}"/> </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: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 rtl="0"> <a:defRPr 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="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}" xmlns:c16r3="http://schemas.microsoft.com/office/drawing/2017/03/chart"> <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 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: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:printSettings> <c:headerFooter/> <c:pageMargins b="0.75" l="0.7" r="0.7" t="0.75" header="0.3" footer="0.3"/> <c:pageSetup/> </c:printSettings> </c:chartSpace>
This is created by Excel, for the same chart setup. This works as expected, the only difference I see is redundant spPr tags ( for example, in title tag ), and txPr tags in title.
I would be happy to give additional information if necessary.
Also, It would be helpful to know if there is a proper way to edit the XML contents as you mentioned, instead of ZIP.
-
John Korchok • 6,126 Reputation points
2025-06-23T16:40:09.7633333+00:00 You mention "older" charts, but have not said how old or in what version of Excel those were created. That information is essential to re-creating the effect you mention.
As an example, if these are charts from Office 2003 or earlier, those use a very different charting algorithm and I would not expect them to follow modern OOXML standards.
-
Jeff McCashland • 481 Reputation points • Microsoft Employee • Moderator
2025-06-23T21:12:11.3366667+00:00 Hello Revanth,
Thank you for posting your question. One of our Protocols engineers will respond soon.
Jeff McCashland
Microsoft Protocols Support
-
Mike Bowen • 2,051 Reputation points • Microsoft Employee • Moderator
2025-06-23T21:37:58.73+00:00 Hi @Revanth Kumar ,
I will help you investigate this issue. To help me determine what's happening here, please answer a few questions:
- Is the situation that you have a .xls file that is being converted to a .xlsx file?
- If so, how is the file being converted to .xlsx? Are you using Excel or something else?
- Please share the original/unconverted .xls file
- If the original/unconverted file is .xlsx please share it as well.
You wrote:
I have a PieChart with 3 datapoints, and Color Scheme 3 a/c to the XML contents which all adhere to Schema definitions perfectly. Yet When I open the xlsx file, Add more Datapoints, the colors of the datapoints are not Color Scheme 3, Instead they are the default datapoint colors you would get from <c:style id="2"
- Do you mean that the original 3 datapoints have the correct color, but any additional points use the default color or are the original 3 datapoints converted to the default color as well?
Best regards,
Michael Bowen
Microsoft Open Specifications
-
Mike Bowen • 2,051 Reputation points • Microsoft Employee • Moderator
2025-06-23T21:53:39.74+00:00 Hi @Revanth Kumar,
If you can share the entire file that would be helpful in addition to the snippets you posted above.
As far as manipulating the underlying XML, if you want to do it programmatically, we have a Nuget package that provides tools for working with Office Word, Excel, and PowerPoint documents: OpenXml SDK.
If you are interested in examining and editing the xml manually, there is a VS Code extension for that: OOXML Viewer.
Michael Bowen
Microsoft Open Specifications
-
Revanth Kumar • 0 Reputation points
2025-06-24T06:12:53.75+00:00 The older charts I am referring to are from the namespace xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart".
The original written file is XML folder, converted to ZIP programmatically.
The original is written using Poco Library.As for my issue, The original 3 colors, are intact and as expected, but new datapoint colors doesn't follow the style1.xml and color1.xml ( Color Scheme 3, accent1, 3, 5 pattern in this case ), and instead fallback to style id=2 default datapoint colors (or whichever style id is present under chartSpace tag).
Steps to recreate on your side using Any modern Excel ( 365 ) and OOXML Viewer.
- 3 random values in to 3 cells, use these 3 values to create a Piechart. You should see 3 datapoints. Change the Color Palette to Scheme 3 (accent1, 3, 5 pattern namely).
- Save the file. View the contents in OOXML Viewer in VS Code, and open chart1.xml. You can see there are multiple redundant spPr/txPr tags in it, as compared to OOXML Schemas in xmlns:c="http://schemas.openxmlformats.org/drawingml/2006/chart" namespace.
- Now, if remove just one redundant tag, say blank spPr in title, and save the contents from VS Code, Open it again in Excel, you will now see that it ignores color1.xml and style1.xml for new datapoints ( old datapoints stay intact ).
I cannot seem to upload the .xlsx file here. Any email address would be helpful to forward the file.
-
Mike Bowen • 2,051 Reputation points • Microsoft Employee • Moderator
2025-06-24T20:38:46.0933333+00:00 Hi @Revanth Kumar, thanks for the update. Please email the file to dochelp@microsoft.com and please include a link to this case and mention that it is for Michael Bowen (me).
Thanks,
Michael
-
Mike Bowen • 2,051 Reputation points • Microsoft Employee • Moderator
2025-06-24T21:31:39.5566667+00:00 Hi again @Revanth Kumar,
I have been unable to reproduce the issue. If I remove the
spPr
fromtitle
with no properties, I don't see any color changes. When you send an email to dochelp@microsoft.com, could you also please include the new file that has the issue as well as the original.Thanks,
Michael
-
Revanth Kumar • 0 Reputation points
2025-06-25T05:57:59.09+00:00 I have forwarded the
Original
working file, and theEdited
file where emptyspPr
tag has been removed in <title> using OOXML Viewer VSCode.When you say you didn't find any color changes, by that do you mean, you created new datapoints and the new colors follow color scheme 3? Or just that the existing datapoint colors are unchanged? I have attached two screenshots, showing how the colors for new datapoints are off, not existing datapoints.
I am using Microsoft Excel 360, macOS 15.5.
Best,
Revanth
Sign in to comment