Paper Office
paper-pptxAPI referencechart.data

Category

paper-pptx 0.2.0 API reference

A chart category, primarily having a label to be displayed on the category axis, but also able to be configured in a hierarchy for support of multi-level category charts.

Category(label, parent)

Attributes

depth

attributedepth

The number of hierarchy levels rooted at this category node. Returns 1 if this category has no sub-categories.

idx

attributeidx

The offset of this category in the overall sequence of leaf categories. A non-leaf category gets the index of its first sub-category.

label

attributelabel

The value that appears on the axis for this category. The label can be a string, a number, or a datetime.date or datetime.datetime object.

leaf_count

attributeleaf_count

The number of leaf category nodes under this category. Returns 1 if this category has no sub-categories.

sub_categories

attributesub_categories

The sequence of child categories for this category.

Functions

add_sub_category

funcadd_sub_category(label)

Return a newly created data.Category object having label and appended to the end of the sub-category sequence for this category.

paramlabel

index

funcindex(sub_category)

The offset of sub_category in the overall sequence of leaf categories.

paramsub_category

numeric_str_val

funcnumeric_str_val(date_1904=False)

The string representation of the numeric (or date) label of this category, suitable for use in the XML c:pt element for this category. The optional date_1904 parameter specifies the epoch used for calculating Excel date numbers.

paramdate_1904
= False

On this page