style1.xml and color1.xml files not recognized by Excel for older charts

Revanth Kumar 0 Reputation points
2025-06-23T12:37:05.0066667+00:00

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
{count} votes

1 answer

Sort by: Most helpful
  1. Mike Bowen 2,056 Reputation points Microsoft Employee Moderator
    2025-07-16T18:07:14.9233333+00:00

    The short answer is spPr is optional in the chart part, but its absence means “I have no formatting”. That’s why they are seeing this behavior.

     

    More details:

     

    spPr is optional, but if you remove the shape properties Excel will have to make some choices about how it displays things (colors are one of the things in that property bag). This element IS a part of the ISO standard though.

     

    style1.xml and color1.xml for charts (a feature we call Chart Styles) are MSFT extensions to ISO 29500 and is not defined in the standards docs. They were added after standardization, in O14, and are documented in MS-ODRAWXML. One challenge is that because style information is stored in multiple places we have to determine which one is authoritative when they diverge. In those cases we sometimes will drop the chart styles from the file - which is completely fine because these are optional, nonstandard extensions.

     

    By deleting the shape properties those now no longer match the style so we throw it all away to make it work. This is by design.

     

    I also tested creating an xlsx file from scratch and you can create a valid xlsx file with a pie chart and the unique colors you assign in styles1 and colors1, and while Excel will open and render the pie chart and custom colors without the redundant spPr elements, the Excel the Chart Design tab will not work.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.