none
What do c:ser/c:idx and c:ser/c:order do?

    Question

  • I asked in the Excel for developers forum and got no answers so asking here:

    21.2.2.84 idx says:

    This element specifies the index of the containing element. This index shall determine which of the parent's children collection this element applies to.

    What/where is this index used? I don't see anything where these index values can be applied.

    One item of note, these values are unique across all charts and series in each chart.

    21.2.2.128 order says:
    This element specifies the order of the series in the collection. It is 0 based.

    I'm guessing this is the order in which this series is listed in the series drop-down in chart formatting. Is that its sole purpose?

    thanks - dave


    What we did for the last 6 months - Made the world's coolest reporting & docgen system even more amazing


    • Edited by DavidThi808 Wednesday, December 5, 2018 1:07 PM
    Tuesday, December 4, 2018 6:42 PM

Answers

  • Hi Dave, 

    Thanks for the question. If you check the schema, you can see that the idx element (for Charts) is used in a number of complex types like CT_DLbl (i.e. 21.2.2.47 dLbl (Data Label)) and CT_BandFmt (i.e. 21.2.2.13 bandFmt (Band Format)). 

    Example for Data Label (21.2.2.47 dLbl (Data Label)):

    <c:dLbls>
        <c:dLbl>
           <c:idx val="5"/>
           <c:tx>
               <c:rich>
                    <a:bodyPr/>
                    <a:lstStyle/>
                    <a:p>
                    <a:r>
                    <a:rPr lang="en-US"/>
                    <a:t>8</a:t>
                    </a:r>
                    </a:p>
    In the above example: 

    <c:idx val="5"/>

    Simply identifies this lable element as being the 5th in the series.

    Hope this helps to clear things up.

    Best regards,
    Tom Jebo
    Sr Escalation Engineer
    Microsoft Open Specifications

    Wednesday, December 5, 2018 3:37 AM
    Moderator
  • Dave, 

    Yes, that's correct. The order element specified where in the series the data is shown visually, specifically, you'll see it in the legend like this: 

    Then changing the data to make the "Series 1" data move to the end (moving the spreadsheet column to the right) causes this: 

    For the first image above, the c:ser block looks like this:

            <c:ser>
              <c:idx val="0"/>
              <c:order val="0"/>
              <c:tx>
                <c:strRef>
                  <c:f>Sheet1!$B$1</c:f>
                  <c:strCache>
                    <c:ptCount val="1"/>
                    <c:pt idx="0">
                      <c:v>Series 1</c:v>


    After moving the column of data, the c:ser block will look like this:

            <c:ser>
              <c:idx val="2"/>
              <c:order val="2"/>
              <c:tx>
                <c:strRef>
                  <c:f>Sheet1!$D$1</c:f>
                  <c:strCache>
                    <c:ptCount val="1"/>
                    <c:pt idx="0">
                      <c:v>Series 1</c:v>

    I should clarify that idx is the index in the XML of this c:ser block. The order is the visual order of the series data on the rendered chart. 

    Hope this helps,

    Tom


    Thursday, December 6, 2018 11:25 PM
    Moderator

All replies

  • Hi Dave, 

    Thanks for the question. If you check the schema, you can see that the idx element (for Charts) is used in a number of complex types like CT_DLbl (i.e. 21.2.2.47 dLbl (Data Label)) and CT_BandFmt (i.e. 21.2.2.13 bandFmt (Band Format)). 

    Example for Data Label (21.2.2.47 dLbl (Data Label)):

    <c:dLbls>
        <c:dLbl>
           <c:idx val="5"/>
           <c:tx>
               <c:rich>
                    <a:bodyPr/>
                    <a:lstStyle/>
                    <a:p>
                    <a:r>
                    <a:rPr lang="en-US"/>
                    <a:t>8</a:t>
                    </a:r>
                    </a:p>
    In the above example: 

    <c:idx val="5"/>

    Simply identifies this lable element as being the 5th in the series.

    Hope this helps to clear things up.

    Best regards,
    Tom Jebo
    Sr Escalation Engineer
    Microsoft Open Specifications

    Wednesday, December 5, 2018 3:37 AM
    Moderator
  • Hi Tom;

    That makes sense and is what I thought it was for. What does order do then? Is that the order it is displayed as opposed to its index in the data?

    thanks - dave


    What we did for the last 6 months - Made the world's coolest reporting & docgen system even more amazing

    Wednesday, December 5, 2018 1:07 PM
  • Dave, 

    Yes, that's correct. The order element specified where in the series the data is shown visually, specifically, you'll see it in the legend like this: 

    Then changing the data to make the "Series 1" data move to the end (moving the spreadsheet column to the right) causes this: 

    For the first image above, the c:ser block looks like this:

            <c:ser>
              <c:idx val="0"/>
              <c:order val="0"/>
              <c:tx>
                <c:strRef>
                  <c:f>Sheet1!$B$1</c:f>
                  <c:strCache>
                    <c:ptCount val="1"/>
                    <c:pt idx="0">
                      <c:v>Series 1</c:v>


    After moving the column of data, the c:ser block will look like this:

            <c:ser>
              <c:idx val="2"/>
              <c:order val="2"/>
              <c:tx>
                <c:strRef>
                  <c:f>Sheet1!$D$1</c:f>
                  <c:strCache>
                    <c:ptCount val="1"/>
                    <c:pt idx="0">
                      <c:v>Series 1</c:v>

    I should clarify that idx is the index in the XML of this c:ser block. The order is the visual order of the series data on the rendered chart. 

    Hope this helps,

    Tom


    Thursday, December 6, 2018 11:25 PM
    Moderator