ooodev.format.chart2.direct.series.data_labels.data_labels package

Module contents

class ooodev.format.chart2.direct.series.data_labels.data_labels.AttribOptions(placement=None, separator=None)[source]

Bases: StyleBase

Chart Data Series, Data Labels Text Attribute Options.

__init__(placement=None, separator=None)[source]

Constructor

Parameters:
  • placement (PlacementKind, optional) – Specifies the placement of data labels relative to the objects.

  • separator (SeparatorKind, optional) – Specifies the separator between multiple text strings for the same object.

Return type:

None

property prop_format_kind: FormatKind

Gets the kind of style

Return type:

FormatKind

property prop_placement: PlacementKind | None

Gets or sets the placement kind

Return type:

PlacementKind | None

property prop_separator: SeparatorKind | None

Gets or sets the separator kind

Return type:

SeparatorKind | None

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

Bases: Numbers

Chart Data Series, Data Labels Number 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: object)[source]
apply(obj: object, **kwargs: Any)
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 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:

NumberFormat

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:

NumberFormat

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:

NumberFormat

class ooodev.format.chart2.direct.series.data_labels.data_labels.Orientation(angle=None, mode=None, leaders=None)[source]

Bases: StyleBase

Series data points Text orientation.

New in version 0.9.4.

__init__(angle=None, mode=None, leaders=None)[source]

Constructor

Parameters:
  • angle (int, Angle, optional) – Rotation in degrees of the text.

  • mode (DirectionModeKind, optional) – Specifies the writing direction.

  • leaders (bool, optional) – Leader Lines. Connect displaced data points to data points.

Return type:

None

Note

When setting a data point leaders is ignored. To set leaders set it on the data series.

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

property prop_angle: Angle | None

Gets/Sets the rotation of the text.

Return type:

Angle | None

property prop_format_kind: FormatKind

Gets the kind of style

Return type:

FormatKind

property prop_leaders: bool | None

Gets/Sets whether to show leaders.

Return type:

bool | None

property prop_mode: DirectionModeKind | None

Gets/Sets writing mode.

Return type:

DirectionModeKind | None

class ooodev.format.chart2.direct.series.data_labels.data_labels.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

class ooodev.format.chart2.direct.series.data_labels.data_labels.TextAttribs(show_number=False, show_number_in_percent=False, show_category_name=False, show_legend_symbol=False, show_custom_label=False, show_series_name=False, auto_text_wrap=None)[source]

Bases: StyleMulti

Chart Data Series, Data Labels Text Attributes.

Any properties starting with prop_ set or get current instance values.

__init__(show_number=False, show_number_in_percent=False, show_category_name=False, show_legend_symbol=False, show_custom_label=False, show_series_name=False, auto_text_wrap=None)[source]

Constructor.

Parameters:
  • show_number (bool, optional) – if True, the value that is represented by a data point is displayed next to it. Defaults to False.

  • show_number_in_percent (bool, optional) – Only effective, if ShowNumber is True. If this member is also True, the numbers are displayed as percentages of a category. That means, if a data point is the first one of a series, the percentage is calculated by using the first data points of all available series. Defaults to False.

  • show_category_name (bool, optional) – Specifies the caption contains the category name of the category to which a data point belongs. Defaults to False.

  • show_legend_symbol (bool, optional) – Specifies the symbol of data series is additionally displayed in the caption. Since LibreOffice 7.1. Defaults to False.

  • show_custom_label (bool, optional) – Specifies the caption contains a custom label text, which belongs to a data point label. Defaults to False.

  • show_series_name (bool, optional) – Specifies the name of the data series is additionally displayed in the caption. Since LibreOffice 7.2. Defaults to False.

  • auto_text_wrap (bool, optional) – Specifies the text is automatically wrapped, if the text is too long to fit in the available space.

Return type:

None

copy(**kwargs)[source]

Copies the style

Return type:

TextAttribs

property auto_text_wrap: TextAttribs

Gets a copy of the style with prop_auto_text_wrap set to True

Return type:

TextAttribs

property prop_auto_text_wrap: bool | None

Gets or set if the text is automatically wrapped, if the text is too long to fit in the available space.

Return type:

bool | None

property prop_format_kind: FormatKind

Gets the kind of style

Return type:

FormatKind

property prop_show_category_name: bool

Gets or set if the caption contains the category name of the category to which a data point belongs

Return type:

bool

property prop_show_custom_label: bool

Gets or set if a custom label is additionally displayed in the caption.

Since LibreOffice 7.1

Return type:

bool

property prop_show_legend_symbol: bool

Gets or set if the legend symbol is additionally displayed in the caption.

Return type:

bool

property prop_show_number: bool

Gets or set if the number is additionally displayed in the caption.

Return type:

bool

property prop_show_number_in_percent: bool

Only effective, if ShowNumber is True.

If this member is also True, the numbers are displayed as percentages of a category

Return type:

bool

property prop_show_series_name: bool

Gets or set if the caption contains the name of the series to which a data point belongs.

Since LibreOffice 7.2

Return type:

bool

property show_category_name: TextAttribs

Gets a copy of the style with prop_show_category_name set to True

Return type:

TextAttribs

property show_custom_label: TextAttribs

Gets a copy of the style with prop_show_custom_label set to True

Return type:

TextAttribs

property show_legend_symbol: TextAttribs

Gets a copy of the style with prop_show_legend_symbol set to True

Return type:

TextAttribs

property show_number: TextAttribs

Gets a copy of the style with prop_show_number set to True

Return type:

TextAttribs

property show_number_in_percent: TextAttribs

Gets a copy of the style with prop_show_number_in_percent set to True

Return type:

TextAttribs

property show_series_name: TextAttribs

Gets a copy of the style with prop_show_series_name set to True

Return type:

TextAttribs