ooodev.format.proto.chart2.series.data_labels.data_labels.numbers_t module

protocol ooodev.format.proto.chart2.series.data_labels.data_labels.numbers_t.NumbersT[source]

Bases: NumbersT, Protocol

Numbers Protocol

Classes that implement this protocol must have the following methods / attributes:

__init__(chart_doc, *, source_format=True, num_format=Ellipsis, num_format_index=Ellipsis, lang_locale=Ellipsis)[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) – Type of a number format. Use this to select a default format. Defaults to 0 (General Format). Only used if num_format_index is -1 (omitted).

  • num_format_index (NumberFormatIndexEnum, int, optional) – Index of a number format. The enumeration values represent the built-in number formats. Defaults to -1.

  • lang_locale (Locale, optional) – Locale of the number format. Defaults to None which used current Locale.

Return type:

None

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 NumberFormat property of an object such as a cell.

Parameters:
  • chart_doc (XChartDocument) – Chart document.

  • index (int) – Format (NumberFormat) 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:

NumbersT

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:

NumbersT

__protocol_attrs__ = {'add_event_listener', 'add_event_observer', 'apply', 'backup', 'boolean', 'copy', 'currency', 'date', 'datetime', 'fraction', 'from_index', 'from_obj', 'from_str', 'general', 'get_attrs', 'get_props', 'get_update_obj', 'has_update_obj', 'number', 'on_applied', 'on_applying', 'on_property_backed_up', 'on_property_backing_up', 'on_property_restore_set', 'on_property_restore_setting', 'on_property_set', 'on_property_set_error', 'percent', 'prop_format_key', 'prop_format_kind', 'prop_format_str', 'prop_has_attribs', 'prop_has_backup', 'prop_parent', 'remove_event_listener', 'remove_event_observer', 'restore', 'scientific', 'set_update_obj', 'support_service', 'text', 'time', 'update'}
property boolean: Self

Gets boolean format

Return type:

Self

property currency: Self

Gets currency format

Return type:

Self

property date: Self

Gets date format

Return type:

Self

property datetime: Self

Gets datetime format

Return type:

Self

property fraction: Self

Gets fraction format

Return type:

Self

property general: Self

Gets general format

Return type:

Self

property number: Self

Gets number format

Return type:

Self

property percent: Self

Gets percent format

Return type:

Self

property scientific: Self

Gets scientific format

Return type:

Self

property text: Self

Gets text format

Return type:

Self

property time: Self

Gets time format

Return type:

Self