question

DavidThielen-0658 avatar image
0 Votes"
DavidThielen-0658 asked MikeBowen-1599 answered

How can I set the fallback chart format, and then force it to create a colors.xml & styles.xml

Hi all;

I'm trying to figure out a way to have Word (or Excel) set c:chartSpace/mc:alternateContent/mc:Fallback/c:style@val to a specific value (1 ... 48). And force it to create the colors1.xml and styles1.xml to match that val.

I can't find any way in Word to set what that fallback value is. And if I directly edit the chart1.xml file to give it another value, it reverts it back to 2 on the next save.

I have found it will create the colors1.xml & styles1.xml if I do something like set the border of a single bar in a bar chart. But I'm not 100% sure that this is the true settings for val=2 (only val I can get working) vs. the settings for a val=2 bar chart (i.e. missing some styles for other chart types).

??? - thanks - dave

openspecs-office-fileformats
· 6
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi Dave

Thank you for contacting Microsoft Open Specifications Support. One of the engineers will contact you shortly.

0 Votes 0 ·

Hi Dave,

I am still trying to get the default values for you from style.xml and colors.xml. I will look into this too. Likely when I figure out how the defaults work there will also be an answer to this question.

Best,

-Mike

0 Votes 0 ·

Hi;

Thank you. And please pass on to the Office team that the update a DOCX/XLSX/PPTX to the latest should update the chart to using style1.xml & colors1.xml. I'm guessing that upgrade part was missed somehow.

thanks - dave

0 Votes 0 ·

Hi Dave,

So this was a file created in an earlier version of Office then opened in the latest version and saved as an updated file?

-Mike

0 Votes 0 ·
Show more comments

1 Answer

MikeBowen-1599 avatar image
0 Votes"
MikeBowen-1599 answered

Hi @DavidThielen-0658 ,

The defaults for a style number are what you see in the style.xml and color.xml for the chart using that style (redundancy for backwards compatibility). So, creating a new chart with a given style should produce style/color parts where you can see the details.

If there is no style/color parts for a chart, then from MS-ODRAWXML 2.7.3.5:


2.7.3.5 CT_Style
Target namespace: http://schemas.microsoft.com/office/drawing/2007/8/2/chart
Referenced by: style
A complex type that specifies a chart style ([ISO/IEC29500-1:2016] section 21.2).
If this element exists, the CT_Style element ([ISO/IEC29500-4:2016] section A.5.1) that is a
descendent of the CT_ChartSpace element ([ISO/IEC29500-4:2016] section A.5.1) that is the
ancestor of this element MUST exist, SHOULD<87> be ignored, and MUST have a val attribute equal
to the val attribute of this element minus 100.
Attributes:
val: An ST_Style attribute that specifies a chart style.

What's happening here is that if there is no style/colors parts then the values are taken from ISO/IEC 29500-1:2016 21.2.3.46 ST_Style (Style) using the value minus 100. E.g. <c14:style val="102"/> maps to <c:style val="2"/> if there are no style/colors parts.

Best,
Mike

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.