Marker settings in the style1.xml file

David Thielen 61 Reputation points
2021-03-21T21:15:59.287+00:00

Hi all;

In the chart1.xml a marker is defined as:

                    <c:marker>
                        <c:symbol val="square"/>
                        <c:size val="5"/>
                        <c:spPr>
                            <a:gradFill rotWithShape="1">
                                <a:gsLst>
                                    <a:gs pos="0">
                                        <a:schemeClr val="accent1">
                                            <a:satMod val="103000"/>
                                            <a:lumMod val="102000"/>
                                            <a:tint val="94000"/>
                                        </a:schemeClr>
                                    </a:gs>
                                    <a:gs pos="50000">
                                        <a:schemeClr val="accent1">
                                            <a:satMod val="110000"/>
                                            <a:lumMod val="100000"/>
                                            <a:shade val="100000"/>
                                        </a:schemeClr>
                                    </a:gs>
                                    <a:gs pos="100000">
                                        <a:schemeClr val="accent1">
                                            <a:lumMod val="99000"/>
                                            <a:satMod val="120000"/>
                                            <a:shade val="78000"/>
                                        </a:schemeClr>
                                    </a:gs>
                                </a:gsLst>
                                <a:lin ang="5400000" scaled="0"/>
                            </a:gradFill>
                            <a:ln w="9525">
                                <a:solidFill>
                                    <a:schemeClr val="accent1"/>
                                </a:solidFill>
                                <a:round/>
                            </a:ln>
                            <a:effectLst>
                                <a:outerShdw blurRad="57150" dist="19050" dir="5400000" algn="ctr"
                                    rotWithShape="0">
                                    <a:srgbClr val="000000">
                                        <a:alpha val="63000"/>
                                    </a:srgbClr>
                                </a:outerShdw>
                            </a:effectLst>
                        </c:spPr>
                    </c:marker>

while in style1.xml it is defined as:

    <cs:dataPointMarker>
        <cs:lnRef idx="0">
            <cs:styleClr val="auto"/>
        </cs:lnRef>
        <cs:fillRef idx="1">
            <cs:styleClr val="auto"/>
        </cs:fillRef>
        <cs:effectRef idx="0"/>
        <cs:fontRef idx="minor">
            <a:schemeClr val="tx1"/>
        </cs:fontRef>
        <cs:spPr>
            <a:ln w="9525">
                <a:solidFill>
                    <a:schemeClr val="phClr"/>
                </a:solidFill>
            </a:ln>
        </cs:spPr>
    </cs:dataPointMarker>
    <cs:dataPointMarkerLayout symbol="circle" size="5"/>

How do the style1.xml properties map over to the marker properties in chart1.xml? They seem to be two very different ways of defining the same thing.

And what/where is the color phClr?

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

2 answers

Sort by: Most helpful
  1. Mike Bowen 1,516 Reputation points Microsoft Employee
    2021-04-02T19:00:58.553+00:00

    Hi @David Thielen ,

    phClr is a color used in theme definitions which means to use the color of the style. See ISO/IEC 29500-1:2016 20.1.10.54 ST_SchemeColorVal (Scheme Color) for more and other color definitions.

    Some elements map directly to elements in the ISO-29500 standard.

    • schemeClr: A CT_SchemeColor ([ISO/IEC29500-1:2016] section A.4.1) element that specifies a color bound to a user's theme. See ([ISO/IEC29500-1:2016] section 20.1.2.3.29).
    • spPr: A CT_ShapeProperties element ([ISO/IEC29500-1:2016] section A.4.1) that specifies visual shape properties of the shape

    Not all properties in styles.xml map directly to properties in chart.xml, however, some elements are extensions of ISO/IEC29500-1:2016 with additional elements or properties.

    • lnRef, fillRef, and effectRef are instances of 2.8.3.8 CT_StyleReference , which is an extensions of CT_StyleMatrixReference ([ISO/IEC29500-1:2016] section A.4.1) but also allows for a CT_StyleColor (section 2.8.3.6) element and a modifier list.
    • fontRef 2.8.3.4 CT_FontReference a reference to the document's font scheme.<93> This element is identical to CT_FontReference ([ISO/IEC29500-1:2016] section A.4.1) but also allows for a CT_StyleColor (section 2.8.3.6) element and a modifier list

    Other elements are extensions.

    • styleClr 2.8.3.6 CT_StyleColor The complex type specifies a color which is retrieved from CT_ColorStyle (section 2.8.3.2).<95> special element used to retrieve colors Referenced by: CT_StyleReference, CT_FontReference.

    There’s no table for which elements fall into each category, you have to dig through the documentation. E.g. for fontRef the steps I took to find the definition were:

    • MS-ODRAWXML 2.8.3.7 CT_StyleEntry has this definition for fontRef:
    • fontRef: A CT_FontReference element that specifies a reference to a themed font.
    • Next the definition for CT_FontReference
    • MS-ODRAWXML 2.8.3.4 CT_FontReference A reference to the document's font scheme.<93> This element is identical to CT_FontReference ([ISO/IEC29500-1:2016] section A.4.1) but also allows for a CT_StyleColor (section 2.8.3.6) element and a modifier list

    So, in this case fontRef is a CT_FontReference ([ISO/IEC29500-1:2016] section A.4.1) that allows for a CT_StyleColor (section 2.8.3.6) element and a modifier list.

    I hope that answers your question.

    Best,
    -Mike


  2. Mike Bowen 1,516 Reputation points Microsoft Employee
    2021-04-14T22:40:47.827+00:00

    Hi @David Thielen ,

    I have investigated this further and found out why changing the val for the style element doesn't change anything if it's edited. The style element in the chart.xml part is only used if there is no relationship to a style.xml part and the style elements for a given val in the style element are added inline. I created a .docx file with the relationships removed that demonstrates this, but unfortunately Q&A will not allow attaching .docx files, so I will email it to you.

    If you use Visual Studio Code (and if you aren't you should be :-) I contribute to an extension for editing the xml parts underlying OOXML files, the OOXML Viewer VS Code. With VS Code and this extension you can edit a .docx file and see the different values for different values for <style val="..." />and how they change depending on val.

    • Install Visual Studio Code and add the OOXML Viewer VS Code extension.
    • Create a .docx file and insert a chart.
    • Open the folder containing the .docx file in VS Code.
    • Right click on the .docx file and click "Open OOXML Package"
    • Open 'word\charts_rels\chart1.xml.rels' and delete the <Relationship /> parts for colors1.xml and style1.xml and save.
    • Open the .docx file in Word and select the chart and 'Format->Reset to Match Style' or right click and 'Reset to Match Style'.
    • Save the .docx in Word
    • Go back to VS Code, you will be able to right click on the chart1.xml part and select 'Compare with Previous' to view the elements that were added.

    Please note, the .docx file must be stored locally (i.e. not on OneNote or DropBox, etc.) .

    Let me know if this answers your question.

    Best!

    -Mike

    0 comments No comments