ooodev.format.inner.direct.chart2.chart.numbers.numbers module

class ooodev.format.inner.direct.chart2.chart.numbers.numbers.Numbers(chart_doc, *, num_format=0, num_format_index=-1, lang_locale=None)[source]

Bases: Numbers

Chart Numbers format.

New in version 0.9.4.

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

Constructor

Parameters:
  • chart_doc (XChartDocument) – Chart document.

  • 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

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

Creates a copy of the instance.

Returns:

Copy of the instance.

Return type:

Numbers

Parameters:

self (_TNumbers) –

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.

Returns:

Instance that represents numbers format.

Return type:

Numbers

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:

Numbers

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.

Returns:

Instance that represents numbers format.

Return type:

Numbers

property prop_format_kind: FormatKind

Gets the kind of style

Return type:

FormatKind