ooodev.format.inner.direct.chart2.series.data_labels.data_labels.percent_format module

class ooodev.format.inner.direct.chart2.series.data_labels.data_labels.percent_format.PercentFormat(chart_doc, *, source_format=True, num_format=0, num_format_index=-1, lang_locale=None)[source]

Bases: Numbers

Chart Data Series, Data Labels Percent Format.

__init__(chart_doc, *, source_format=True, num_format=0, num_format_index=-1, lang_locale=None)[source]

Constructor

Parameters:
  • chart_doc (XChartDocument) – Chart document.

  • source_format (bool, optional) – Specifies whether the number format should be linked to the source format. Defaults to True.

  • num_format (NumberFormatEnum, int, optional) – specifies the number format. Defaults to 0.

  • num_format_index (NumberFormatIndexEnum | int, optional) – Specifies the number format index. Defaults to -1.

  • lang_locale (Locale, optional) – Specifies the language locale. Defaults to None.

Return type:

None

apply(obj: Any)[source]
apply(obj: Any, **kwargs)
apply(obj, **kwargs)

Applies styles to object

Parameters:
  • obj (object) – UNO Object that styles are to be applied.

  • kwargs (Any, optional) – Expandable list of key value pairs that may be used in child classes.

Keyword Arguments:

format_key (Any, optional) – NumberFormat key, overrides prop_format_key property value.

Return type:

None

copy()[source]
copy(**kwargs)
copy(**kwargs)

Creates a copy of the instance.

Returns:

Copy of the instance.

Return type:

Numbers

classmethod from_index(chart_doc, index, lang_locale=None, **kwargs)[source]

Gets instance from number format index. This is the index that is assigned to the PercentageNumberFormat property of an object such as a cell.

Parameters:
  • chart_doc (XChartDocument) – Chart document.

  • index (int) – Format (PercentageNumberFormat) index.

  • lang_locale (Locale, optional) – Locale. Defaults to None.

Keyword Arguments:

source_format (bool, optional) – If True, the number format will be linked to the source format. Defaults to False.

Returns:

Instance that represents numbers format.

Return type:

PercentFormat

classmethod from_obj(chart_doc, obj)[source]
classmethod from_obj(chart_doc, obj, **kwargs)
classmethod from_obj(chart_doc, obj, **kwargs)

Gets instance from object

Parameters:
  • chart_doc (XChartDocument) – Chart document.

  • obj (object) – UNO Object.

Raises:

NotSupportedError – If obj is not supported.

Returns:

Instance that represents numbers format.

Return type:

PercentFormat

classmethod from_str(chart_doc, nf_str, lang_locale=None, auto_add=False, **kwargs)[source]

Gets instance from format string

Parameters:
  • chart_doc (XChartDocument) – Chart document.

  • nf_str (str) – Format string.

  • lang_locale (Locale, optional) – Locale. Defaults to None.

  • auto_add (bool, optional) – If True, format string will be added to document if not found. Defaults to False.

Keyword Arguments:

source_format (bool, optional) – If True, the number format will be linked to the source format. Defaults to False.

Returns:

Instance that represents numbers format.

Return type:

PercentFormat

on_property_set_error(source, event_args)[source]

Triggers for each property that fails to set.

Parameters:
  • source (Any) – Event Source.

  • event_args (KeyValArgs) – Event Args

Return type:

None