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
attributedepthThe number of hierarchy levels rooted at this category node. Returns 1 if this category has no sub-categories.
idx
attributeidxThe offset of this category in the overall sequence of leaf categories. A non-leaf category gets the index of its first sub-category.
label
attributelabelThe 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_countThe number of leaf category nodes under this category. Returns 1 if this category has no sub-categories.
sub_categories
attributesub_categoriesThe 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.
paramlabelindex
funcindex(sub_category)The offset of sub_category in the overall sequence of leaf categories.
paramsub_categorynumeric_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