ChartData
paper-pptx 0.2.0 API reference
ChartData is simply an alias for CategoryChartData and may be removed
in a future release. All new development should use CategoryChartData
for creating or replacing the data in chart types other than XY and
Bubble.
Attributes
categories
attributecategoriesdata.Categories object providing access to category-object hierarchy.
Assigning an iterable of category labels (strings, numbers, or dates) replaces
the data.Categories object with a new one containing a category for each label
in the sequence.
Creating a chart from chart data having date categories will cause the chart to
have a DateAxis for its category axis.
categories_ref
attributecategories_refThe Excel worksheet reference to the categories for this chart (not including the column heading).
number_format
attributenumber_formatThe formatting template string, e.g. '#,##0.0', that determines how X and Y values are formatted in this chart and in the Excel spreadsheet. A number format specified on a series will override this value for that series. Likewise, a distinct number format can be specified for a particular data point within a series.
xlsx_blob
attributexlsx_blobReturn a blob containing an Excel workbook file populated with the contents of this chart data object.
Functions
__getitem__
func__getitem__(index)paramindex__len__
func__len__()add_category
funcadd_category(label)Return a newly created data.Category object having label and
appended to the end of the category collection for this chart.
label can be a string, a number, a datetime.date, or
datetime.datetime object. All category labels in a chart must be the
same type. All category labels in a chart having multi-level
categories must be strings.
paramlabeladd_series
funcadd_series(name, values=(), number_format=None)Add a series to this data set entitled name and having the data points specified by values, an iterable of numeric values. number_format specifies how the series values will be displayed, and may be a string, e.g. '#,##0' corresponding to an Excel number format.
paramnameparamvalues= ()paramnumber_format= Noneappend
funcappend(series)paramseriesdata_point_offset
funcdata_point_offset(series)The total integer number of data points appearing in the series of this chart that are prior to series in this sequence.
paramseriesseries_index
funcseries_index(series)Return the integer index of series in this sequence.
paramseriesseries_name_ref
funcseries_name_ref(series)Return the Excel worksheet reference to the cell containing the name for series.
paramseriesvalues_ref
funcvalues_ref(series)The Excel worksheet reference to the values for series (not including the column heading).
paramseriesx_values_ref
funcx_values_ref(series)The Excel worksheet reference to the X values for series (not including the column label).
paramseriesxml_bytes
funcxml_bytes(chart_type)Return a blob containing the XML for a chart of chart_type containing the series in this chart data object, as bytes suitable for writing directly to a file.
paramchart_typey_values_ref
funcy_values_ref(series)The Excel worksheet reference to the Y values for series (not including the column label).
paramseries