Class ChartDataPoint

class ooodev.calc.chart2.chart_data_point.ChartDataPoint(owner, chart_doc, component, lo_inst=None)[source]

Bases: LoInstPropsPartial, PropertySetComp, ChartDocPropPartial, FontEffectsPartial, FontOnlyPartial, FontPartial, DataPointPropertiesPartial, FillPropertiesPartial, QiPartial, ServicePartial, CalcDocPropPartial, CalcSheetPropPartial, NumbersNumbersPartial, FillColorPartial, ChartFillGradientPartial, ChartFillHatchPartial, ChartFillImgPartial, ChartFillPatternPartial, BorderLinePropertiesPartial, TransparencyPartial, GradientPartial, DataLabelBorderPartial, Chart2DataLabelAttribOptPartial, Chart2DataLabelPercentFormatPartial, Chart2DataLabelOrientationPartial, Chart2DataLabelTextAttributePartial

Class for managing Chart2 Chart Data Point Component.

Parameters:
__init__(owner, chart_doc, component, lo_inst=None)[source]

Constructor

Parameters:
  • component (Any) – UNO Chart2 Chart Data Point Component.

  • lo_inst (LoInst, optional) – Lo Instance. Use when creating multiple documents. Defaults to None.

  • owner (ChartDataSeries) –

  • chart_doc (ChartDoc) –

Return type:

None

add_event_property_change(name, cb)

Adds a listener for an event.

Event is invoked when property is changed.

The callback EventArgs.event_data will contain a com.sun.star.beans.PropertyChangeEvent struct.

Parameters:
  • name (str) – Property Name

  • cb (EventArgsCallbackT) – Callback

Return type:

None

add_event_property_change_events_disposing(name, cb)

Adds a listener for an event.

Event is invoked when the property listener is about to be disposed.

The callback EventArgs.event_data will contain a UNO com.sun.star.lang.EventObject struct.

Parameters:
  • name (str) – Property Name

  • cb (EventArgsCallbackT) – Callback

Return type:

None

add_event_vetoable_change(name, cb)

Adds a listener for an event.

Event is invoked when property is changed.

The callback EventArgs.event_data will contain a com.sun.star.beans.PropertyChangeEvent struct.

Parameters:
  • name (str) – Property Name

  • cb (EventArgsCallbackT) – Callback

Return type:

None

add_event_vetoable_change_events_disposing(name, cb)

Adds a listener for an event.

Event is invoked when the property listener is about to be disposed.

The callback EventArgs.event_data will contain a UNO com.sun.star.lang.EventObject struct.

Parameters:
  • name (str) – Property Name

  • cb (EventArgsCallbackT) – Callback

Return type:

None

add_property_change_listener(name, listener)

Adds a listener for property changes.

Parameters:
  • name (str) – The name of the property.

  • listener (Any) – The listener to be added.

Return type:

None

add_vetoable_change_listener(name, listener)

Adds a listener for vetoable changes.

Parameters:
  • name (str) – The name of the property.

  • listener (Any) – The listener to be added.

Return type:

None

get_property_set_info()

Returns the property set info.

Returns:

The property set info.

Return type:

XPropertySetInfo

get_property_value(name)

Returns the value of a property.

Parameters:

name (str) – The name of the property.

Returns:

The value of the property.

Return type:

Any

get_services()

Gets service names for the instance.

Returns:

service names

Return type:

List[str]

qi(atype, raise_err=False)

Generic method that get an interface instance from an object.

Parameters:
  • atype (T) – Interface type to query obj for. Any Uno class that starts with ‘X’ such as XInterface

  • raise_err (bool, optional) – If True then raises MissingInterfaceError if result is None. Default False

Raises:

MissingInterfaceError – If ‘raise_err’ is ‘True’ and result is None

Returns:

instance of interface if supported; Otherwise, None

Return type:

T | None

Note

When raise_err=True return value will never be None.

remove_event_property_change(name)

Removes a listener for an event

Parameters:

name (str) – Property Name

Return type:

None

remove_event_property_change_events_disposing(name)

Removes a listener for an event

Parameters:

name (str) – Property Name

Return type:

None

remove_event_vetoable_change(name)

Removes a listener for an event

Parameters:

name (str) – Property Name

Return type:

None

remove_event_vetoable_change_events_disposing(name)

Removes a listener for an event

Parameters:

name (str) – Property Name

Return type:

None

remove_property_change_listener(name, listener)

Removes a listener for property changes.

Parameters:
  • name (str) – The name of the property.

  • listener (Any) – The listener to be removed.

Return type:

None

remove_vetoable_change_listener(name, listener)

Removes a listener for vetoable changes.

Parameters:
  • name (str) – The name of the property.

  • listener (Any) – The listener to be removed.

Return type:

None

set_property_value(name, value)

Sets the value of a property.

Parameters:
  • name (str) – The name of the property.

  • value (Any) – The value of the property.

Return type:

None

style_area_color(color=-1)

Style Area Color.

Parameters:

color (Color, optional) – FillColor Color. Defaults to StandardColor.AUTO_COLOR.

Raises:

CancelEventError – If the event before_style_area_color is cancelled and not handled.

Returns:

FillColor instance or None if cancelled.

Return type:

FillColorT | None

style_area_color_get()

Gets the Area Color Style.

Raises:

CancelEventError – If the event before_style_area_color_get is cancelled and not handled.

Returns:

Area color style or None if cancelled.

Return type:

FillColorT | None

style_area_gradient(*, style=GradientStyle.LINEAR, step_count=0, offset=Offset(x=50, y=50), angle=0, border=0, grad_color=ColorRange(start=0, end=16777215), grad_intensity=IntensityRange(start=100, end=100), name='')

Style Area Color.

Parameters:
  • style (GradientStyle, optional) – Specifies the style of the gradient. Defaults to GradientStyle.LINEAR.

  • step_count (int, optional) – Specifies the number of steps of change color. Defaults to 0.

  • offset (Offset, int, optional) – Specifies the X and Y coordinate, where the gradient begins. X is effectively the center of the RADIAL, ELLIPTICAL, SQUARE and RECT style gradients. Defaults to Offset(50, 50).

  • angle (Angle, int, optional) – Specifies angle of the gradient. Defaults to 0.

  • border (int, optional) – Specifies percent of the total width where just the start color is used. Defaults to 0.

  • grad_color (ColorRange, optional) – Specifies the color at the start point and stop point of the gradient. Defaults to ColorRange(Color(0), Color(16777215)).

  • grad_intensity (IntensityRange, optional) – Specifies the intensity at the start point and stop point of the gradient. Defaults to IntensityRange(100, 100).

  • name (str, optional) – Specifies the Fill Gradient Name.

Raises:

CancelEventError – If the event before_style_area_gradient is cancelled and not handled.

Returns:

Chart Fill Gradient instance or None if cancelled.

Return type:

ChartFillGradientT | None

Hint

  • GradientStyle can be imported from ooo.dyn.awt.gradient_style

  • Angle can be imported from ooodev.units

  • ColorRange can be imported from ooodev.utils.data_type.color_range

  • Intensity can be imported from ooodev.utils.data_type.intensity

  • IntensityRange can be imported from ooodev.utils.data_type.intensity_range

  • Offset can be imported from ooodev.utils.data_type.offset

style_area_gradient_from_preset(preset)

Style Area Gradient from Preset.

Parameters:

preset (PresetGradientKind) – Preset Gradient Kind.

Returns:

Chart Fill Gradient instance.

Return type:

ChartFillGradientT

Hint

  • PresetGradientKind can be imported from ooodev.format.inner.preset.preset_gradient

style_area_gradient_get()

Gets the Area Gradient Style.

Raises:

CancelEventError – If the event before_style_area_gradient_get is cancelled and not handled.

Returns:

Gradient style or None if cancelled.

Return type:

ChartFillGradientT | None

style_area_hatch(*, style=HatchStyle.SINGLE, color=0, space=0, angle=0, bg_color=-1)

Style Area Color.

Parameters:
  • style (HatchStyle, optional) – Specifies the kind of lines used to draw this hatch. Default HatchStyle.SINGLE.

  • color (Color, optional) – Specifies the color of the hatch lines. Default 0.

  • space (float, UnitT, optional) – Specifies the space between the lines in the hatch (in mm units) or Class UnitT. Default 0.0

  • angle (Angle, int, optional) – Specifies angle of the hatch in degrees. Default to 0.

  • bg_color (Color, optional) – Specifies the background Color. Set this -1 (default) for no background color.

Raises:

CancelEventError – If the event before_style_area_hatch is cancelled and not handled.

Returns:

Fill Image instance or None if cancelled.

Return type:

ChartFillHatchT | None

Hint

  • Angle can be imported from ooodev.units

  • HatchStyle can be imported from ooo.dyn.drawing.hatch_style

style_area_hatch_from_preset(preset)

Style Area Gradient from Preset.

Parameters:

preset (PresetHatchKind) – Preset Hatch Kind.

Returns:

Chart Fill Hatch instance or None if before_style_area_hatch_from_preset event is cancelled.

Return type:

ChartFillHatchT | None

Hint

  • PresetHatchKind can be imported from ooodev.format.inner.preset.preset_hatch

style_area_image(*, bitmap=None, name='', mode=ImgStyleKind.TILED, size=None, position=None, pos_offset=None, tile_offset=None, auto_name=False)

Style Area Color.

Parameters:
  • bitmap (XBitmap, optional) – Bitmap instance. If name is not already in the Bitmap Table then this property is required.

  • name (str, optional) – Specifies the name of the image. This is also the name that is used to store bitmap in LibreOffice Bitmap Table.

  • mode (ImgStyleKind, optional) – Specifies the image style, tiled, stretched etc. Default ImgStyleKind.TILED.

  • size (SizePercent, SizeMM, optional) – Size in percent (0 - 100) or size in mm units.

  • position (RectanglePoint) – Tiling position of Image.

  • pos_offset (Offset, optional) – Tiling position offset.

  • tile_offset (OffsetColumn, OffsetRow, optional) – The tiling offset.

  • auto_name (bool, optional) – Specifies if name is ensured to be unique. Defaults to False.

Raises:

CancelEventError – If the event before_style_area_img is cancelled and not handled.

Returns:

Fill Image instance or None if cancelled.

Return type:

ChartFillImgT | None

Hint

  • RectanglePoint can be imported from ooo.dyn.drawing.rectangle_point

  • ImgStyleKind can be imported from ooodev.format.inner.direct.write.fill.area.img

  • SizePercent can be imported from ooodev.format.inner.common.format_types.size_percent

  • SizeMM can be imported from ooodev.utils.data_type.size_mm

  • OffsetColumn can be imported from ooodev.format.inner.common.format_types.offset_column

  • OffsetRow can be imported from ooodev.format.inner.common.format_types.offset_row

  • Offset can be imported from ooodev.utils.data_type.offset

style_area_image_from_preset(preset)

Style Area Gradient from Preset.

Parameters:

preset (PresetImageKind) – Preset Image Kind.

Returns:

Chart Fill Image instance.

Return type:

ChartFillImgT

Hint

  • PresetImageKind can be imported from ooodev.format.inner.preset.preset_image

style_area_image_get()

Gets the Area Area Image Style.

Raises:

CancelEventError – If the event before_style_area_img_get is cancelled and not handled.

Returns:

Area image style or None if cancelled.

Return type:

ChartFillImgT | None

style_area_pattern(*, bitmap=None, name='', tile=True, stretch=False, auto_name=False)

Style Area Color.

Parameters:
  • bitmap (XBitmap, optional) – Bitmap instance. If name is not already in the Bitmap Table then this property is required.

  • name (str, optional) – Specifies the name of the pattern. This is also the name that is used to store bitmap in LibreOffice Bitmap Table.

  • tile (bool, optional) – Specified if bitmap is tiled. Defaults to True.

  • stretch (bool, optional) – Specifies if bitmap is stretched. Defaults to False.

  • auto_name (bool, optional) – Specifies if name is ensured to be unique. Defaults to False.

Raises:

CancelEventError – If the event before_style_area_pattern is cancelled and not handled.

Returns:

Fill Image instance or None if cancelled.

Return type:

ChartFillPatternT | None

style_area_pattern_from_preset(preset)

Style Area Gradient from Preset.

Parameters:

preset (PresetPatternKind) – Preset Image Kind.

Returns:

Chart Fill Image instance.

Return type:

ChartFillPatternT

Hint

  • PresetPatternKind can be imported from ooodev.format.inner.preset.preset_pattern

style_area_pattern_get()

Gets the Area Area Pattern Style.

Raises:

CancelEventError – If the event before_style_area_pattern_get is cancelled and not handled.

Returns:

Area pattern style or None if cancelled.

Return type:

ChartFillPatternT | None

style_area_transparency_gradient(*, style=GradientStyle.LINEAR, offset=Offset(x=50, y=50), angle=0, border=0, grad_intensity=IntensityRange(start=0, end=0))

Style Area Color.

Parameters:
  • style (GradientStyle, optional) – Specifies the style of the gradient. Defaults to GradientStyle.LINEAR.

  • step_count (int, optional) – Specifies the number of steps of change color. Defaults to 0.

  • offset (offset, optional) – Specifies the X-coordinate (start) and Y-coordinate (end), where the gradient begins. X is effectively the center of the RADIAL, ELLIPTICAL, SQUARE and RECT style gradients. Defaults to Offset(50, 50).

  • angle (Angle, int, optional) – Specifies angle of the gradient. Defaults to 0.

  • border (int, optional) – Specifies percent of the total width where just the start color is used. Defaults to 0.

  • grad_intensity (IntensityRange, optional) – Specifies the intensity at the start point and stop point of the gradient. Defaults to IntensityRange(0, 0).

Raises:

CancelEventError – If the event before_style_area_transparency_gradient is cancelled and not handled.

Returns:

FillColor instance or None if cancelled.

Return type:

GradientT | None

Hint

  • GradientStyle can be imported from ooo.dyn.awt.gradient_style

  • IntensityRange can be imported from ooodev.utils.data_type.intensity_range

  • Offset can be imported from ooodev.utils.data_type.offset

  • Angle can be imported from ooodev.units

  • Intensity can be imported from ooodev.utils.data_type.intensity

style_area_transparency_gradient_get()

Gets the Area Transparency Gradient Style.

Raises:

CancelEventError – If the event before_style_area_transparency_gradient_get is cancelled and not handled.

Returns:

Area transparency style or None if cancelled.

Return type:

GradientT | None

style_area_transparency_transparency(value=0)

Style Area Color.

Parameters:

value (Intensity, int, optional) – Specifies the transparency value from 0 to 100.

Raises:

CancelEventError – If the event before_style_area_transparency_transparency is cancelled and not handled.

Returns:

FillColor instance or None if cancelled.

Return type:

TransparencyT | None

Hint

  • The value of 0 is fully opaque.

  • The value of 100 is fully transparent.

  • Intensity can be imported from ooodev.utils.data_type.intensity

style_area_transparency_transparency_get()

Gets the Area Transparency Style.

Raises:

CancelEventError – If the event before_style_area_transparency_transparency_get is cancelled and not handled.

Returns:

Area transparency style or None if cancelled.

Return type:

TransparencyT | None

style_attribute_options(placement=None, separator=None)

Style Chart2 Data Label Attribute Options.

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.

Raises:

CancelEventError – If the event before_style_chart2_data_label_attribute_opt is cancelled and not handled.

Returns:

Attribute Options Style instance or None if cancelled.

Return type:

AttribOptions | None

Hint

PlacementKind, SeparatorKind and AttribOptions can be imported from ooodev.format.inner.direct.chart2.series.data_labels.data_labels.attrib_options

style_border_line(color=0, width=0, transparency=0, style=BorderLineKind.CONTINUOUS)

Style border line.

Parameters:
  • color (Color, optional) – Line Color. Defaults to Color(0).

  • width (float | UnitT, optional) – Line Width (in mm units) or Class UnitT. Defaults to 0.

  • transparency (int | Intensity, optional) – Line transparency from 0 to 100. Defaults to 0.

  • style (BorderLineKind, optional) – Line style. Defaults to BorderLineKind.CONTINUOUS.

Raises:

CancelEventError – If the event before_style_chart_border_line is cancelled and not handled.

Returns:

Line properties style or None if cancelled.

Return type:

LinePropertiesT | None

Hint

  • BorderLineKind can be imported from ooodev.format.inner.preset.preset_border_line

  • Intensity can be imported from ooodev.utils.data_type.intensity

style_border_line_get()

Gets the line properties style.

Raises:

CancelEventError – If the event before_style_chart_border_line_get is cancelled and not handled.

Returns:

Line properties style or None if cancelled.

Return type:

LinePropertiesT | None

style_font(name=None, size=None, font_style=None, lang=None)

Style Font.

Parameters:
  • name (str | None, optional) – Font Name.

  • size (float | UnitT | None, optional) – Font Size in PT units or UnitT.

  • font_style (str | None, optional) – Font Style such as Bold Italics

  • lang (FontLangT | None, optional) – Font Language.

Raises:

CancelEventError – If the event before_style_font_only is cancelled and not handled.

Returns:

Font Only instance or None if cancelled.

Return type:

FontOnlyT | None

See also

FontLang

style_font_effect(*, color=None, transparency=None, overline=None, underline=None, strike=None, word_mode=None, case=None, relief=None, outline=None, hidden=None, shadowed=None)

Style Font options.

Parameters:
  • color (Color, optional) – The value of the text color. If value is -1 the automatic color is applied.

  • transparency (Intensity, int, optional) – The transparency value from 0 to 100 for the font color.

  • overline (FontLine, optional) – Character overline values.

  • underline (FontLine, optional) – Character underline values.

  • strike (FontStrikeoutEnum, optional) – Determines the type of the strike out of the character.

  • word_mode (bool, optional) – If True, the underline and strike-through properties are not applied to white spaces.

  • case (CaseMapEnum, optional) – Specifies the case of the font.

  • relief (FontReliefEnum, optional) – Specifies the relief of the font.

  • outline (bool, optional) – Specifies if the font is outlined.

  • hidden (bool, optional) – Specifies if the font is hidden.

  • shadowed (bool, optional) – Specifies if the characters are formatted and displayed with a shadow effect.

Raises:

CancelEventError – If the event before_style_font_effect is cancelled and not handled.

Returns:

Font Effects instance or None if cancelled.

Return type:

FontEffectsT | None

Hint

  • CaseMapEnum can be imported from ooo.dyn.style.case_map

  • FontReliefEnum can be imported from ooo.dyn.awt.font_relief

  • FontStrikeoutEnum can be imported from ooo.dyn.awt.font_strikeout

  • FontLine can be imported from ooodev.format.inner.direct.write.char.font.font_effects

  • Intensity can be imported from ooodev.utils.data_type.intensity

  • FontUnderlineEnum can be imported from ooo.dyn.awt.font_underline

style_font_effect_get()

Gets the font effect Style.

Raises:

CancelEventError – If the event before_style_font_effect_get is cancelled and not handled.

Returns:

Font Effect style or None if cancelled.

Return type:

FontEffectsT | None

style_font_effect_line(line=None, color=None, overline=False)

Style Font Underline or Overline.

This method is a subset of style_font_effect() method for convenience.

Parameters:
  • color (Color, optional) – The value of the text color. If value is -1 the automatic color is applied.

  • line (FontUnderlineEnum, optional) – Font Line kind.

  • overline (bool, optional) – If True the line is overline, otherwise it is underline.

Raises:

CancelEventError – If the event before_style_font_effect is cancelled and not handled.

Returns:

Font Effects instance or None if cancelled.

Return type:

FontEffectsT | None

Hint

  • FontUnderlineEnum can be imported from ooo.dyn.awt.font_underline

style_font_general(b=None, i=None, u=None, bg_color=None, bg_transparent=None, charset=None, color=None, family=None, name=None, overline=None, rotation=None, shadow_fmt=None, shadowed=None, size=None, slant=None, spacing=None, strike=None, subscript=None, superscript=None, underline=None, weight=None, word_mode=None)

Style Font.

Parameters:
  • b (bool, optional) – Shortcut to set weight to bold.

  • i (bool, optional) – Shortcut to set slant to italic.

  • u (bool, optional) – Shortcut ot set underline to underline.

  • bg_color (Color, optional) – The value of the text background color.

  • bg_transparent (bool, optional) – Determines if the text background color is set to transparent.

  • charset (CharSetEnum, optional) – The text encoding of the font.

  • color (Color, optional) – The value of the text color. Setting to -1 will cause automatic color.

  • family (FontFamilyEnum, optional) – Font Family.

  • name (str, optional) – This property specifies the name of the font style. It may contain more than one name separated by comma.

  • overline (FontLine, optional) – Character overline values.

  • rotation (int, Angle, optional) – Specifies the rotation of a character in degrees. Depending on the implementation only certain values may be allowed.

  • shadow_fmt (ShadowFormat | None) – (ShadowFormat, optional): Determines the type, color, and width of the shadow.

  • shadowed (bool, optional) – Specifies if the characters are formatted and displayed with a shadow effect.

  • size (float, UnitT, optional) – This value contains the size of the characters in pt (point) units or Class UnitT.

  • slant (FontSlant, optional) – The value of the posture of the document such as FontSlant.ITALIC.

  • spacing (CharSpacingKind, float, UnitT, optional) – Specifies character spacing in pt (point) units or Class UnitT.

  • strike (FontStrikeoutEnum, optional) – Determines the type of the strike out of the character.

  • subscript (bool, optional) – Subscript option.

  • superscript (bool, optional) – Superscript option.

  • underline (FontLine, optional) – Character underline values.

  • weight (FontWeightEnum, optional) – The value of the font weight.

  • word_mode (bool, optional) – If True, the underline and strike-through properties are not applied to white spaces.

Raises:

CancelEventError – If the event before_style_general_font is cancelled and not handled.

Returns:

Font instance or None if cancelled.

Return type:

FontT | None

Hint

  • FontFamilyEnum can be imported from ooo.dyn.awt.font_family

  • CharSetEnum can be imported from ooo.dyn.awt.char_set

  • ShadowFormat can be imported from ooo.dyn.table.shadow_format

  • FontSlant can be imported from ooo.dyn.awt.font_slant

  • FontStrikeoutEnum can be imported from ooo.dyn.awt.font_strikeout

  • FontWeightEnum can be imported from ooo.dyn.awt.font_weight

  • FontLine can be imported from ooodev.format.inner.direct.write.char.font.font_effects

  • CharSpacingKind can be imported from ooodev.format.inner.direct.write.char.font.font_position

style_font_get()

Gets the font Style.

Raises:

CancelEventError – If the event before_style_font_only_get is cancelled and not handled.

Returns:

Font style or None if cancelled.

Return type:

FontOnlyT | None

style_label_border_line(color=0, width=0, transparency=0, style=BorderLineKind.CONTINUOUS)

Style Label Border Line.

Parameters:
  • color (Color, optional) – Line Color. Defaults to Color(0).

  • width (float | UnitT, optional) – Line Width (in mm units) or Class UnitT. Defaults to 0.

  • transparency (int | Intensity, optional) – Line transparency from 0 to 100. Defaults to 0.

  • style (BorderLineKind, optional) – Line style. Defaults to BorderLineKind.CONTINUOUS.

Raises:

CancelEventError – If the event before_style_data_label_border_line is cancelled and not handled.

Returns:

Border Line Style or None if cancelled.

Return type:

LinePropertiesT | None

Hint

  • BorderLineKind can be imported from ooodev.format.inner.preset.preset_border_line

  • Intensity can be imported from ooodev.utils.data_type.intensity

style_label_border_line_get()

Gets the line properties style.

Raises:

CancelEventError – If the event before_style_data_label_border_line_get is cancelled and not handled.

Returns:

Line properties style or None if cancelled.

Return type:

LinePropertiesT | None

style_numbers_numbers(source_format=True, num_format=0, num_format_index=-1, lang_locale=None)

Style Numbers.

Parameters:
  • 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.

  • source_format (bool) –

Raises:

CancelEventError – If the event before_style_number_number is cancelled and not handled.

Returns:

Number Style instance or None if cancelled.

Return type:

NumbersT | None

Hint

  • Locale can be imported from ooo.dyn.lang.locale

  • NumberFormatEnum can be imported from ooo.dyn.util.number_format

  • NumberFormatIndexEnum can be imported from ooo.dyn.i18n.number_format_index

style_numbers_numbers_get()

Gets the Numbers Style.

Raises:

CancelEventError – If the event before_style_number_number_get is cancelled and not handled.

Returns:

Numbers style or None if cancelled.

Return type:

NumbersT | None

style_numbers_numbers_get_from_index(idx, locale=None)

Gets the Numbers Style.

Raises:

CancelEventError – If the event before_style_number_number_from_index is cancelled and not handled.

Returns:

Numbers style or None if cancelled.

Return type:

NumbersT | None

Parameters:
  • idx (int) –

  • locale (Locale | None) –

style_numbers_numbers_get_from_str(nf_str, locale=None, auto_add=False, source_format=False)

Gets the Numbers Style.

Parameters:
  • 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.

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

  • locale (Locale | None) –

Raises:

CancelEventError – If the event before_style_number_number_from_index is cancelled and not handled.

Returns:

Number style or None if cancelled.

Return type:

NumbersT | None

style_numbers_percent(*, source_format=True, num_format=0, num_format_index=-1, lang_locale=None)

Style Chart2 Data Series Text Attributes.

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.

Raises:

CancelEventError – If the event before_style_chart2_data_label_format_percent is cancelled and not handled.

Returns:

Percent Format Style instance or None if cancelled.

Return type:

PercentFormat | None

Hint

  • NumberFormatEnum can be imported from ooo.dyn.util.number_format

  • NumberFormatIndexEnum can be imported from ooo.dyn.i18n.number_format_index

  • PercentFormat can be imported from ooodev.format.inner.direct.chart2.series.data_labels.data_labels.percent_format

style_numbers_percent_get()

Gets the number percent Style.

Raises:

CancelEventError – If the event before_style_chart2_data_label_format_percent_get is cancelled and not handled.

Returns:

Number percent style or None if cancelled.

Return type:

PercentFormat | None

style_orientation(angle=None, mode=None, leaders=None)

Style Chart2 Data Series Text Attributes.

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.

Raises:

CancelEventError – If the event before_style_chart2_data_label_orientation is cancelled and not handled.

Returns:

Orientation Style instance or None if cancelled.

Return type:

Orientation | None

Hint

  • Angle can be imported from ooodev.units

  • DirectionModeKind can be imported from ooodev.format.inner.direct.chart2.title.alignment.direction

  • Orientation can be imported from ooodev.format.inner.direct.chart2.series.data_labels.data_labels.orientation

style_text_attributes(*, 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)

Style Chart2 Data Series Text Attributes.

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.

Raises:

CancelEventError – If the event before_style_chart2_data_label_text_attribs is cancelled and not handled.

Returns:

Text Attribute Style instance or None if cancelled.

Return type:

AttribOptions | None

support_service(*service)

Gets if instance supports a service.

Parameters:

*service (str) – Variable length argument list of UNO namespace strings such as com.sun.star.configuration.GroupAccess

Returns:

True if instance supports any passed in service; Otherwise, False

Return type:

bool

property border_color: int

Gets/Sets - Is used for borders around filled objects.

See line_color.

Return type:

int

property border_dash: com.sun.star.drawing.LineDash

Gets/Sets - Is used for borders around filled objects.

See LineDash.

Return type:

LineDash

property border_dash_name: str | None

Gets/Sets the name of a dash that can be found in the com.sun.star.container.XNameContainer com.sun.star.drawing.LineDashTable, that can be created via the com.sun.star.uno.XMultiServiceFactory of the Chart Document.

optional

Return type:

str | None

property border_style: com.sun.star.drawing.LineStyle.LineStyleProto

Gets/Sets - Is used for borders around filled objects.

See LineStyle.

Return type:

LineStyleProto

property border_transparency: int | None

Gets/Sets - Is used for borders around filled objects.

See line_transparence.

optional

Return type:

int | None

property border_width: int

Gets/Sets Is used for borders around filled objects.

See line_width.

Return type:

int

property calc_doc: CalcDoc

Calc Document.

Return type:

CalcDoc

property calc_sheet: CalcSheet

Calc Sheet.

Return type:

CalcSheet

property chart_doc: ChartDoc

Chart Document.

Return type:

ChartDoc

property color: Color

Gets/Sets - points to a style that also supports this service (but not this property) that is used as default, if the PropertyState of a property is DEFAULT_VALUE.

This is the main color of a data point.

For charts with filled areas, like bar-charts, this should map to the fill_color of the objects. For line-charts this should map to the line_color property.

Return type:

NewType()(Color, int)

property component: com.sun.star.beans.PropertySet

PropertySet Component

Return type:

PropertySet

property custom_label_fields: Tuple[XDataPointCustomLabelField, ...] | None

Gets/Sets a text with possible fields that is used as a data point label, if set then Label property is ignored.

optional

Return type:

Tuple[XDataPointCustomLabelField, …] | None

property custom_label_position: RelativePosition | None

Gets/Sets - Custom position on the page associated to the CUSTOM label placement.

since

LibreOffice 7.0

optional

Return type:

RelativePosition | None

property error_bar_x: XPropertySet | None

Gets/Sets - If void, no error bars are shown for the data point in x-direction.

The com.sun.star.beans.XPropertySet must support the service ErrorBar.

optional

Return type:

XPropertySet | None

property error_bar_y: XPropertySet | None

Get/Sets - If void, no error bars are shown for the data point in y-direction.

The com.sun.star.beans.XPropertySet must support the service ErrorBar.

optional

Return type:

XPropertySet | None

property fill_background: bool

Gets/Sets - If True, fills the background of a hatch with the color given in the Color property.

Return type:

bool

property fill_bitmap: XBitmap | None

Gets/Sets the bitmap used for filling.

If the property fill_style is set to FillStyle.BITMAP, this is the bitmap used.

optional

Return type:

XBitmap | None

property fill_bitmap_logical_size: bool

Gets/Sets if the size is given in percentage or as an absolute value.

If this is True, the properties fill_bitmap_size_x and fill_bitmap_size_y contain the size of the tile in percent of the size of the original bitmap. If this is False, the size of the tile is specified with 1/100th mm.

Return type:

bool

property fill_bitmap_mode: com.sun.star.drawing.BitmapMode.BitmapModeProto

Gets/Sets - this enum selects how an area is filled with a single bitmap.

Return type:

BitmapModeProto

property fill_bitmap_name: str

Gets/Sets - The name of the fill bitmap.

Return type:

str

property fill_bitmap_offset_x: int

Gets/Sets - This is the horizontal offset where the tile starts.

It is given in percent in relation to the width of the bitmap.

Return type:

int

property fill_bitmap_offset_y: int

Gets/Sets - This is the vertical offset where the tile starts.

It is given in percent in relation to the width of the bitmap.

Return type:

int

property fill_bitmap_position_offset_x: int

Gets/Sets - Every second line of tiles is moved the given percent of the width of the bitmap.

Return type:

int

property fill_bitmap_position_offset_y: int

Gets/Sets - Every second row of tiles is moved the given percent of the width of the bitmap.

Return type:

int

property fill_bitmap_rectangle_point: com.sun.star.drawing.RectanglePoint.RectanglePointProto

Gets/Sets - The RectanglePoint specifies the position inside of the bitmap to use as the top left position for rendering.

Return type:

RectanglePointProto

property fill_bitmap_size_x: int

Gets/Sets - This is the width of the tile for filling.

Depending on the property FillBitmapLogicalSize, this is either relative or absolute.

Return type:

int

property fill_bitmap_size_y: int

Gets/Sets - This is the height of the tile for filling.

Depending on the property FillBitmapLogicalSize, this is either relative or absolute.

Return type:

int

property fill_bitmap_stretch: bool | None

Gets/Sets if the fill bitmap is stretched to fill the area of the shape.

This property should not be used anymore and is included here for completeness. The fill_bitmap_mode property can be used instead to set all supported bitmap modes.

If set to True, the value of the fill_bitmap_mode property changes to BitmapMode.STRETCH. BUT: behavior is undefined, if the property fill_bitmap_tile is True too.

If set to False, the value of the fill_bitmap_mode property changes to BitmapMode.REPEAT or BitmapMode.NO_REPEAT, depending on the current value of the fill_bitmap_tile property.

optional

Return type:

bool | None

property fill_bitmap_tile: bool | None

Get/Sets the fill bitmap is repeated to fill the area of the shape.

This property should not be used anymore and is included here for completeness. The fill_bitmap_mode property can be used instead to set all supported bitmap modes.

If set to True, the value of the fill_bitmap_mode property changes to BitmapMode.REPEAT. BUT: behavior is undefined, if the property fill_bitmap_stretch is True too.

If set to False, the value of the fill_bitmap_mode property changes to BitmapMode.STRETCH or BitmapMode.NO_REPEAT, depending on the current value of the fill_bitmap_stretch property.

optional

Return type:

bool | None

property fill_bitmap_url: str | None

Gets/Sets the URL of the bitmap used for filling.

If the property fill_style is set to FillStyle.BITMAP, this is a URL to the bitmap used.

Note the new behavior since it this was deprecated: This property can only be set and only external URLs are supported (no more vnd.sun.star.GraphicObject scheme). When a URL is set, then it will load the bitmap and set the fill_bitmap property.

optional

Return type:

str | None

property fill_color: com.sun.star.util.Color

Gets/Sets the color used for filling.

If the property fill_style is set to FillStyle.SOLID, this is the color used.

Return type:

Color

property fill_gradient: GradientStructComp | None

Gets/Sets the gradient used for filling.

If the property fill_style is set to FillStyle.GRADIENT, this describes the gradient used.

Note when setting the gradient it can be a GradientStructComp or a Gradient struct.

optional

Returns:

Gradient Struct Component or None if not supported.

Return type:

GradientStructComp | None

Hint

  • Gradient can be imported from ooo.dyn.awt.gradient.

property fill_gradient_name: str

Gets/Sets the name of the used fill gradient style.

If the property fill_style is set to FillStyle.GRADIENT, this is the name of the used fill gradient style.

Return type:

str

property fill_hatch: HatchStructComp | None

Gets/Sets the hatch used for filling.

If the property fill_style is set to FillStyle.HATCH, this describes the hatch used.

optional

Return type:

HatchStructComp | None

property fill_hatch_name: str

Gets/Sets the name of the used fill hatch style.

If the property fill_style is set to FillStyle.HATCH, this is the name of the used fill hatch style.

Return type:

str

property fill_style: com.sun.star.drawing.FillStyle.FillStyleProto

Gets/Sets - This enumeration selects the style with which the area will be filled.

Return type:

FillStyleProto

property fill_transparence: int

Gets/Sets the transparence of the filled area.

This property is only valid if the property fill_style is set to FillStyle.SOLID.

Return type:

int

property fill_transparence_gradient: GradientStructComp | None

Gets/Sets the transparency of the fill area as a gradient.

Note when setting the gradient it can be a GradientStructComp or a Gradient struct.

optional

Returns:

Gradient Struct Component or None if not supported.

Return type:

GradientStructComp | None

Hint

  • Gradient can be imported from ooo.dyn.awt.gradient.

property fill_transparence_gradient_name: str

Gets/Sets the name of the used transparence gradient style.

If a gradient is used for transparency, this is the name of the used transparence gradient style or it is empty.

If you set the name of a transparence gradient style contained in the document, this style used.

Return type:

str

property fill_use_slide_background: bool | None

The area displays the slide background.

since

LibreOffice 7.4

optional

Type:

If this is True, and fill_style is FillStyle.NONE

Return type:

bool | None

property geometry3d: int | None

Gets/Sets the geometry of a 3 dimensional data point.

Number is one of constant group DataPointGeometry3D.

This is especially used for 3D bar-charts.

CUBOID==0 CYLINDER==1 CONE==2 PYRAMID==3 CUBOID==else

optional

Return type:

int | None

property gradient: Gradient | None

Gets/Sets the gradient.

optional

Return type:

Gradient | None

property gradient_name: str

Gets/Sets the name of the gradient.

Return type:

str

property graphic_crop: GraphicCropStructComp[UnitMM100] | None

Gets/Sets the cropping of the object.

If the property fill_bitmap_mode is set to BitmapMode.STRETCH, this is the cropping, otherwise it is empty.

When setting the cropping it can be a GraphicCropStructComp or a GraphicCrop struct.

optional

Returns:

Graphic Crop Struct Component or None if not supported.

Return type:

GraphicCropStructComp | None

Hint

  • GraphicCrop can be imported from ooo.dyn.text.graphic_crop.

property hatch: Hatch | None

Gets/Sets the hatch.

optional

Return type:

Hatch | None

property hatch_name: str

Gets/Sets the name of the hatch.

Return type:

str

property label: com.sun.star.chart2.DataPointLabel

Gets/Sets the data point label.

Return type:

DataPointLabel

property label_placement: int | None

Gets/Sets a relative position for the data label.

optional

Return type:

int | None

property label_separator: str | None

Gets/Sets a string that is used to separate the parts of a data label (caption).

optional

Return type:

str | None

property line_dash: com.sun.star.drawing.LineDash

Gets/Sets - Is only used for line-chart types.

Return type:

LineDash

property line_dash_name: str | None

Gets/Sets the name of a dash that can be found in the com.sun.star.container.XNameContainer com.sun.star.drawing.LineDashTable, that can be created via the com.sun.star.uno.XMultiServiceFactory of the Chart Document.

optional

Return type:

str | None

property line_style: com.sun.star.drawing.LineStyle.LineStyleProto

Gets/Sets the line style.

Return type:

LineStyleProto

property line_width: int

Gets/Sets - Is only used for line-chart types.

Return type:

int

property lo_inst: LoInst

Lo Instance

Return type:

LoInst

property number_format: int | None

Gets/Sets a number format for the display of the value in the data label.

optional

Return type:

int | None

property office_doc: OfficeDocumentT

Office Document.

Return type:

OfficeDocumentT

property offset: float | None

Gets/sets a value by which a data point is moved from its default position in percent of the maximum allowed distance.

This is especially useful for the explosion of pie-chart segments.

optional

Return type:

float | None

property owner: ChartDataSeries

Gets the owner of this Chart Data Point.

Return type:

ChartDataSeries

property percent_diagonal: int | None

Gets/Seta a value between 0 and 100 indicating the percentage how round an edge should be.

optional

Return type:

int | None

property percentage_number_format: int | None

Gets/Sets a number format for the display of the percentage value in the data label.

optional

Return type:

int | None

property reference_page_size: Size | None

Gets/Sets - The size of the page at the moment when the font size for data labels was set.

This size is used to resize text in the view when the size of the page has changed since the font sizes were set (automatic text scaling).

optional

Return type:

Size | None

property show_error_box: bool | None

Gets/Sets - In case error_bar_x and error_bar_y both are set, and error bars are shown, a box spanning all error-indicators is rendered.

optional

Return type:

bool | None

property symbol: Symbol | None

Gets/Sets - This is the symbol that is used for a data point.

optional

Return type:

Symbol | None

property text_word_wrap: bool | None

Gets/Sets if the text of a data label (caption) must be wrapped

optional

Return type:

bool | None

property transparency: int

Gets/Sets - This is the main transparency value of a data point.

For charts with filled areas, like bar-charts, this should map to the FillTransparence of the objects. For line-charts this should map to the line_transparence property.

Return type:

int

property transparency_gradient: Gradient | None

Gets/Sets the transparency of the fill area as a gradient.

optional

Return type:

Gradient | None

property transparency_gradient_name: str

Gets/Sets the name of the transparency gradient.

Return type:

str