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

David Thielen 61 Reputation points
2021-03-21T18:32:17.83+00:00

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

Office Open Specifications
Office Open Specifications
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Open Specifications: Technical documents for protocols, computer languages, standards support, and data portability. The goal with Open Specifications is to help developers open new opportunities to interoperate with Windows, SQL, Office, and SharePoint.
119 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Mike Bowen 1,276 Reputation points Microsoft Employee
    2021-03-31T17:01:01.53+00:00

    Hi @David Thielen ,

    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

    0 comments No comments