Chart - Plot Data

The values and categories of each plot is specified by a data set. In the typical case, that data is composed of a sequence of categories and a sequence of series, where each series has a numeric value corresponding to each of the categories.

Candidate protocol

>>> plot = chart.plots[0]
>>> plot.categories
('Foo', 'Bar', 'Baz')
>>> len(plot.series)
3
>>> series = iter(plot.series)
>>> next(series).values
(1.2, 2.3, 3.4)
>>> next(series).values
(4.5, 5.6, 6.7)
>>> next(series).values
(7.8, 8.9, 9.0)

Feature Summary

  • Plot.categories – Read/only for now. Returns tuple of string.

  • Series.values – Read/only for now. Returns tuple of float.

Microsoft API

ChartGroup.CategoryCollection

Returns all the visible categories in the chart group, or the specified visible category.

ChartGroup.SeriesCollection

Returns all the series in the chart group.

Series.Values

Returns or sets a collection of all the values in the series. Read/write Variant. Returns an array of float; accepts a spreadsheet formula or an array of numeric values.

Series.Formula

Returns or sets the object’s formula in A1-style notation. Read/write String.

XML specimens

Example series XML:

<c:ser>
  <!-- ... -->
  <c:cat>
    <c:strRef>
      <c:f>Sheet1!$A$2:$A$4</c:f>
      <c:strCache>
        <c:ptCount val="3"/>
        <c:pt idx="0">
          <c:v>Foo</c:v>
        </c:pt>
        <c:pt idx="1">
          <c:v>Bar</c:v>
        </c:pt>
        <c:pt idx="2">
          <c:v>Baz</c:v>
        </c:pt>
      </c:strCache>
    </c:strRef>
  </c:cat>
  <c:val>
    <c:numRef>
      <c:f>Sheet1!$B$2:$B$4</c:f>
      <c:numCache>
        <c:ptCount val="3"/>
        <c:pt idx="0">
          <c:v>1.2</c:v>
        </c:pt>
        <c:pt idx="1">
          <c:v>2.3</c:v>
        </c:pt>
        <c:pt idx="2">
          <c:v>3.4</c:v>
        </c:pt>
      </c:numCache>
    </c:numRef>
  </c:val>
</c:ser>