Class ChartLegend

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

Bases: LoInstPropsPartial, LegendComp, ChartDocPropPartial, EventsPartial, QiPartial, ServicePartial, CalcDocPropPartial, CalcSheetPropPartial, PropPartial, FontEffectsPartial, FontOnlyPartial, FontPartial, FillColorPartial, TransparencyPartial, GradientPartial, ChartFillGradientPartial, ChartFillHatchPartial, ChartFillImgPartial, ChartFillPatternPartial, BorderLinePropertiesPartial, Chart2LegendPosPartial

Class for managing Chart2 Legend Component.

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

Constructor

Parameters:
  • component (Legend) – UNO Chart2 Legend Component.

  • owner (ChartDiagram) –

  • chart_doc (ChartDoc) –

  • lo_inst (LoInst | None) –

Return type:

None

add_event_observers(*args)

Adds observers that gets their trigger method called when this class trigger method is called.

Parameters:

args (EventObserver) – One or more observers to add.

Return type:

None

Note

Observers are removed automatically when they are out of scope.

add_event_properties_change(names, cb)

Add properties to listen for changes.

Parameters:
  • names (Iterable[str]) – One or more property names to listen for changes.

  • cb (EventArgsCallbackT) – Callback that is invoked when an event is triggered.

Raises:

ValueError – If names is empty.

Return type:

None

Note

The callback EventArgs.event_data will contain a tuple of com.sun.star.beans.PropertyChangeEvent objects.

Each time this method is called, the previous names are removed and the new names are added.

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

fire_event_properties_change(names)

Fires a sequence of PropertyChangeEvents

Parameters:

names (Iterable[str]) – Sequence of property names to fire event for.

Return type:

None

get_property(name, default=<object object>)

Get property value

Parameters:
  • name (str) – Property Name.

  • default (Any, optional) – Return value if property value is None.

Returns:

Property value or default.

Return type:

Any

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_observer(observer)

Removes an observer

Parameters:

observer (EventObserver) – One or more observers to add.

Returns:

True if observer has been removed; Otherwise, False.

Return type:

bool

remove_event_properties_listener()

Remove Properties Listener

Return type:

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(**kwargs)

Set property value

Parameters:

**kwargs (Any) – Variable length Key value pairs used to set properties.

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_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_position(*, pos=None, mode=None, no_overlap=None)

Style Area Color.

Parameters:
  • pos (LegendPosition | None, optional) – Specifies the position of the legend.

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

  • no_overlap (bool | None, optional) – Show the legend without overlapping the chart.

Raises:

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

Returns:

Chart Legend Position style instance or None if cancelled.

Return type:

PositionT | None

Hint

  • LegendPosition can be imported from ooo.dyn.chart2.legend_position.

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

subscribe_event(event_name, callback)

Add an event listener to current instance.

Parameters:
  • event_name (str) – Event Name.

  • callback (EventCallback) – Callback of the event listener.

Return type:

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

trigger_event(event_name, event_args)

Trigger an event on current instance.

Parameters:
  • event_name (str) – Event Name.

  • event_args (EventArgsT) – Event Args.

Return type:

None

unsubscribe_event(event_name, callback)

Remove an event listener from current instance.

Parameters:
  • event_name (str) – Event Name.

  • callback (EventCallback) – Callback of the event listener.

Return type:

None

property anchor_position: com.sun.star.chart2.LegendPosition.LegendPositionProto

Gets/Sets - Provides an automated position.

Return type:

LegendPositionProto

property calc_doc: CalcDoc

Calc Document.

Return type:

CalcDoc

property calc_sheet: CalcSheet

Calc Sheet.

Return type:

CalcSheet

property char_auto_kerning: bool | None

Gets/Sets - This optional property determines whether the kerning tables from the current font are used.

Automatic kerning applies a spacing in between certain pairs of characters to make the text look better.

Optional

Return type:

bool | None

property char_back_color: Color | None

Get/Sets - This optional property contains the text background color.

Optional

Returns:

Color or None if not supported.

Return type:

Color | None

property char_back_transparent: bool | None

Gets/Sets if the text background color is set to transparent.

Optional

Return type:

bool | None

property char_border_distance: UnitMM100 | None

Gets/Sets the distance from the border to the object.

When setting the value, it can be either a float or an instance of UnitT.

Optional

Return type:

UnitMM100 | None

property char_bottom_border: BorderLine2StructComp | None

This property contains the bottom border of the object.

Setting value can be done with a BorderLine2 or BorderLine2StructComp object.

optional

Returns:

Returns BorderLine2 or None if not supported.

Return type:

BorderLine2StructComp | None

Hint

  • BorderLine2 can be imported from ooo.dyn.table.border_line2

property char_bottom_border_distance: UnitMM100 | None

This property contains the distance from the bottom border to the object.

When setting the value, it can be either a float or an instance of UnitT.

optional

Return type:

UnitMM100 | None

property char_case_map: int | None

Gets/Sets - This optional property contains the value of the case-mapping of the text for formatting and displaying.

optional

Return type:

int | None

property char_color: Color

This property contains the value of the text color.

Returns:

Color

Return type:

Color

property char_color_theme: int | None

Gets/Sets - If available, keeps the color theme index, so that the character can be re-colored easily based on a theme.

since

LibreOffice 7.3

optional

Return type:

int | None

property char_color_tint_or_shade: int | None

Gets/Sets the tint or shade of the character color.

since

LibreOffice 7.3

optional

Return type:

int | None

property char_combine_is_on: bool | None

Gets/Sets - This optional property determines whether text is formatted in two lines.

It is linked to the properties char_combine_prefix and char_combine_suffix.

optional

Return type:

bool | None

property char_combine_prefix: str | None

Gets/Sets - This optional property contains the prefix (usually parenthesis) before text that is formatted in two lines.

It is linked to the properties char_combine_is_on and char_combine_suffix.

optional

Return type:

str | None

property char_combine_suffix: str | None

Gets/Sets - This optional property contains the suffix (usually parenthesis) after text that is formatted in two lines.

It is linked to the properties CharCombineIsOn and CharCombinePrefix.

optional

Return type:

str | None

property char_contoured: bool | None

Gets/Sets - This optional property specifies if the characters are formatted and displayed with a contour effect.

optional

Return type:

bool | None

property char_crossed_out: bool | None

Gets/Sets - This property is True if the characters are crossed out.

optional

Return type:

bool | None

property char_emphasis: int | None

Gets/Sets - This optional property contains the font emphasis value.

optional

Return type:

int | None

property char_escapement: int | None

Gets/Sets the percentage by which to raise/lower superscript/subscript characters.

Negative values denote subscripts and positive values superscripts.

optional

Return type:

int | None

property char_escapement_height: int | None

Gets/Sets - This is the relative height used for subscript or superscript characters in units of percent.

The value 100 denotes the original height of the characters.

optional

Return type:

int | None

property char_flash: bool | None

Gets/Sets - If this optional property is True, then the characters are flashing.

optional

Return type:

bool | None

property char_font_char_set: int

Gets/Sets - This property contains the text encoding of the font.

Return type:

int

property char_font_family: int

Get/Sets the font family.

Return type:

int

property char_font_name: str

Gets/Sets the name of the font style.

It may contain more than one name separated by comma.

Return type:

str

property char_font_pitch: int

Gets/Sets the font pitch.

Return type:

int

property char_font_style_name: str

Gets/Sets the name of the font style.

This property may be empty.

Return type:

str

property char_font_type: int | None

Gets/Sets - This optional property specifies the fundamental technology of the font.

optional

Return type:

int | None

property char_height: UnitPT

Gets/Sets - This value contains the height of the characters in point.

When setting the value can be a float (in points) or a UnitT instance.

Return type:

UnitPT

property char_hidden: bool | None

Gets/Sets - If this optional property is True, then the characters are invisible.

optional

Return type:

bool | None

property char_highlight: Color | None

Gets/Sets the color of the highlight.

optional

Returns:

Color

Return type:

Color

property char_interop_grab_bag: Tuple[PropertyValue, ...] | None

Gets/Sets grab bag of character properties, used as a string-any map for interim interop purposes.

This property is intentionally not handled by the ODF filter. Any member that should be handled there should be first moved out from this grab bag to a separate property.

Optional

Return type:

Tuple[PropertyValue, …] | None

property char_keep_together: bool | None

Gets/Sets - This optional property marks a range of characters to prevent it from being broken into two lines.

A line break is applied before the range of characters if the layout makes a break necessary within the range.

optional

Return type:

bool | None

property char_kerning: int | None

Gets/Sets - This optional property contains the value of the kerning of the characters.

optional

Return type:

int | None

property char_left_border: BorderLine2StructComp | None

Gets/Sets - This property contains the left border of the object.

Setting value can be done with a BorderLine2 or BorderLine2StructComp object.

optional

Returns:

Returns BorderLine2 or None if not supported.

Return type:

BorderLine2StructComp | None

Hint

  • BorderLine2 can be imported from ooo.dyn.table.border_line2

property char_left_border_distance: UnitMM100 | None

Gets/Sets - This property contains the distance from the left border to the object.

When setting the value, it can be either a float or an instance of UnitT.

optional

Return type:

UnitMM100 | None

property char_locale: Locale

Gets/Sets - This property contains the value of the locale.

Return type:

Locale

property char_no_hyphenation: bool | None

Gets/Sets - This optional property determines if the word can be hyphenated at the character.

optional

Return type:

bool | None

property char_no_line_break: bool | None

Gets/Sets - This optional property marks a range of characters to ignore a line break in this area.

A line break is applied behind the range of characters if the layout makes a break necessary within the range. That means that the text may go through the border.

optional

Return type:

bool | None

property char_posture: FontSlant

Gets/Sets - This property contains the value of the posture of the document.

Returns:

Returns FontSlant

Return type:

FontSlant

Hint

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

property char_relief: int | None

Gets/Sets - This optional property contains the relief style of the characters.

optional

Return type:

int | None

property char_right_border: BorderLine2StructComp | None

Gets/Sets - This property contains the right border of the object.

Setting value can be done with a BorderLine2 or BorderLine2StructComp object.

optional

Returns:

Returns BorderLine2 or None if not supported.

Return type:

BorderLine2StructComp | None

Hint

  • BorderLine2 can be imported from ooo.dyn.table.border_line2

property char_right_border_distance: UnitMM100 | None

Gets/Sets - This property contains the distance from the right border to the object.

When setting the value, it can be either a float or an instance of UnitT.

optional

Return type:

UnitMM100 | None

property char_rotation: Angle10 | None

Gets/Sets - This optional property determines the rotation of a character in tenths of a degree.

Depending on the implementation only certain values may be allowed.

optional

Returns:

Returns Angle10, 1/10th degrees, or None if not supported.

Return type:

Angle10

Hint

  • Angle10 can be imported from ooodev.units

property char_rotation_is_fit_to_line: bool | None

Gets/Sets - This optional property determines whether the text formatting tries to fit rotated text into the surrounded line height.

optional

Return type:

bool | None

property char_scale_width: int | None

Gets/Sets - This optional property determines the percentage value for scaling the width of characters.

The value refers to the original width which is denoted by 100, and it has to be greater than 0.

optional

Return type:

int | None

property char_shading_value: int | None

Gets/Sets - This optional property contains the text shading value.

optional

Return type:

int | None

property char_shadow_format: ShadowFormatStructComp | None

Gets/Sets the type, color, and width of the shadow.

When setting the value can be an instance of ShadowFormatStructComp or ShadowFormat.

optional

Returns:

Shadow Format or None if not supported.

Return type:

ShadowFormatStructComp

Hint

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

property char_shadowed: bool | None

Gets/Sets - This optional property specifies if the characters are formatted and displayed with a shadow effect.

optional

Return type:

bool | None

property char_strikeout: FontStrikeoutEnum | None

Gets/Sets - This property determines the type of the strike out of the character.

optional

Returns:

Returns FontStrikeoutEnum or None if not supported.

Return type:

FontStrikeoutEnum | None

Hint

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

property char_style_name: str | None

Gets/Sets - This optional property specifies the name of the style of the font.

optional

Return type:

str | None

property char_style_names: Tuple[str, ...] | None

Gets/Sets - This optional property specifies the names of the all styles applied to the font.

It is not guaranteed that the order in the sequence reflects the order of the evaluation of the character style attributes.

Optional

Return type:

Tuple[str, …] | None

property char_top_border: BorderLine2StructComp | None

Gets/Sets - This property contains the top border of the object.

Setting value can be done with a BorderLine2 or BorderLine2StructComp object.

optional

Returns:

Returns BorderLine2 or None if not supported.

Return type:

BorderLine2StructComp | None

Hint

  • BorderLine2 can be imported from ooo.dyn.table.border_line2

property char_top_border_distance: UnitMM100 | None

Gets/Sets - This property contains the distance from the top border to the object.

When setting the value, it can be either a float or an instance of UnitT.

optional

Return type:

UnitMM100 | None

property char_transparence: int | None

Gets/Sets - This is the transparency of the character text.

The value 100 means entirely transparent, while 0 means not transparent at all.

optional

Return type:

int | None

property char_underline: FontUnderlineEnum

This property contains the value for the character underline.

Return type:

FontUnderlineEnum

property char_underline_color: Color

Gets/Sets the color of the underline for the characters.

Returns:

Color

Return type:

Color

property char_underline_has_color: bool

Gets/Sets if the property char_underline_color is used for an underline.

Return type:

bool

property char_weight: float

Gets/Sets the value of the font weight.

Example

from com.sun.star.awt import FontWeight

my_char_properties.char_weight = FontWeight.BOLD
Return type:

float

property char_word_mode: bool | None

Gets/Sets - If this property is True, the underline and strike-through properties are not applied to white spaces.

optional

Return type:

bool | None

property chart_doc: ChartDoc

Chart Document.

Return type:

ChartDoc

property component: com.sun.star.chart2.Legend

Legend Component

Return type:

Legend

property event_observer: EventObserver

Gets/Sets The Event Observer for this instance.

Return type:

EventObserver

property events_listener_properties_change_implement: PropertiesChangeListener

Returns listener

Return type:

PropertiesChangeListener

property expansion: com.sun.star.chart.ChartLegendExpansion.ChartLegendExpansionProto

Gets/Sets how the aspect ratio of the legend should roughly be.

Set the Expansion to com.sun.star.chart.HIGH for a legend that is positioned on the right or left hand side. Use com.sun.star.chart.WIDE for a legend that is positioned on top or the bottom.

Return type:

ChartLegendExpansionProto

property fill_background: bool

Gets/Sets whether the transparent background of a hatch filled area is drawn in the current background color.

If this is True, the transparent background of a hatch filled area is drawn in the current background color.

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: BitmapMode

Gets/Sets how an area is filled with a single bitmap.

This enum selects how an area is filled with a single bitmap.

This property corresponds to the properties fill_bitmap_stretch and fill_bitmap_tile.

If set to BitmapMode.REPEAT, the property fill_bitmap_stretch is set to False, and the property fill_bitmap_tile is set to True.

If set to BitmapMode.STRETCH, the property fill_bitmap_stretch is set to True, and the property fill_bitmap_tile is set to False.

If set to BitmapMode.NO_REPEAT, both properties fill_bitmap_stretch and fill_bitmap_tile are set to False.

Returns:

Bitmap Mode

Return type:

BitmapMode

Hint

  • BitmapMode can be imported from ooo.dyn.drawing.bitmap_mode.

property fill_bitmap_name: str

If the property FillStyle is set to FillStyle.BITMAP, this is the name of the used fill bitmap style.

Return type:

str

property fill_bitmap_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_offset_y: int

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

Return type:

int

property fill_bitmap_position_offset_x: int

Gets/Sets 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_position_offset_y: int

Gets/Sets the vertical offset where the tile starts.

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

Return type:

int

property fill_bitmap_rectangle_point: RectanglePoint

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

Returns:

RectanglePoint specifies the position inside of the bitmap to use as the top left position for rendering.

Return type:

RectanglePoint

Hint

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

property fill_bitmap_size_x: int

Gets/Sets the width of the tile for filling.

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

If fill_bitmap_logical_size is True then property contain the size of the tile in percent of the size of the original bitmap; Otherwise, the size of the tile is specified with 1/100th mm.

Return type:

int

property fill_bitmap_size_y: int

Gets/Sets the height of the tile for filling.

This is the height of the tile for filling.

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

If fill_bitmap_logical_size is True then property contain the size of the tile in percent of the size of the original bitmap; Otherwise, the size of the tile is specified with 1/100th mm.

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: FillStyle

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

Returns:

Fill Style

Return type:

FillStyle

Hint

  • FillStyle can be imported from ooo.dyn.drawing.fill_style.

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 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.

Gets/Sets - This optional property contains the name of the hyperlink.

optional

Return type:

str | None

Gets/Sets - This optional property contains the name of the target for a hyperlink.

optional

Return type:

str | None

Gets/Sets - This optional property contains the URL of a hyperlink.

optional

Return type:

str | None

property line_cap: LineCap | None

Gets/Sets the rendering of ends of thick lines.

optional:

Returns:

The line cap.

Return type:

LineCap

Hint

  • LineCap can be imported from ooo.dyn.drawing.line_cap

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

Gets/Sets the line color.

Return type:

Color

property line_dash: LineDashStructComp

Gets/Sets the dash of the line.

When setting the value can be a LineDash or a LineDashStructComp.

Returns:

The line dash.

Return type:

LineDashStructComp

Hint

  • LineDash can be imported from ooo.dyn.drawing.line_dash

property line_dash_name: str

Gets/Sets the name of the dash of the line.

Return type:

str

property line_end: PolyPolygonBezierCoords | None

Gets/Sets the line end in the form of a poly polygon Bezier.

optional

Return type:

PolyPolygonBezierCoords | None

property line_end_center: bool | None

Gets/Sets the line end center.

If this property is True, the line will end in the center of the polygon.

optional

Return type:

bool | None

property line_end_name: str | None

Gets/Sets the name of the line end poly polygon Bezier.

If this string is empty, no line end polygon is rendered.

optional

Return type:

str | None

property line_end_width: UnitMM100 | None

Gets/Sets the width of the line end polygon.

When setting this property, you can use either an integer or a UnitT object.

optional

Returns:

The width of the line end polygon or None if not available.

Return type:

UnitMM100

Hint

  • UnitMM100 can be imported from ooodev.units.

property line_joint: LineJoint

Gets/Sets the rendering of joints between thick lines.

Returns:

The line joint.

Return type:

LineJoint

Hint

  • LineJoint can be imported from ooo.dyn.drawing.line_joint

property line_start: PolyPolygonBezierCoords | None

Gets/Sets the line start in the form of a poly polygon Bezier.

optional

Return type:

PolyPolygonBezierCoords | None

property line_start_center: bool | None

Gets/Sets the line start center.

If this property is True, the line will start from the center of the polygon.

optional

Return type:

bool | None

property line_start_name: str | None

Gets/Sets the name of the line start poly polygon Bezier.

If this string is empty, no line start polygon is rendered.

optional

Return type:

str | None

property line_start_width: UnitMM100 | None

Gets/Sets the width of the line start polygon.

When setting this property, you can use either an integer or a UnitT object.

optional

Returns:

The width of the line start polygon or None if not available.

Return type:

UnitMM100

Hint

  • UnitMM100 can be imported from ooodev.units.

property line_style: LineStyle

Gets/Sets the type of the line.

Returns:

Line Style.

Return type:

LineStyle

Hint

  • LineStyle can be imported from ooo.dyn.drawing.line_style

property line_transparence: int

Gets/Sets the extent of transparency.

Return type:

int

property line_width: UnitMM100

Gets/Sets the width of the line in 1/100th mm units.

Return type:

UnitMM100

property lo_inst: LoInst

Lo Instance

Return type:

LoInst

property office_doc: OfficeDocumentT

Office Document.

Return type:

OfficeDocumentT

property overlay: bool

Gets/Sets whether the legend should overlay the chart.

since

LibreOffice 7.0

Return type:

bool

property owner: ChartDiagram

Owner Chart Diagram

Return type:

ChartDiagram

property reference_page_size: Size | None

Gets/Sets the size of the page at the time when properties were set (e.g. the CharHeight).

This way it is possible to resize objects (like text) in the view without modifying the model.

My be None

Return type:

Size | None

property relative_position: RelativePosition | None

Gets/Sets the position is as a relative position on the page.

If a relative position is given the legend is not automatically placed, but instead is placed relative on the page.

If None, the legend position is solely determined by the anchor_position.

My be None

Return type:

RelativePosition | None

property ruby_adjust: int | None

Gets/Sets - This optional property determines the adjustment of the ruby .

optional

Return type:

int | None

property ruby_char_style_name: str | None

Gets/Sets - This optional property contains the name of the character style that is applied to RubyText.

optional

Return type:

str | None

property ruby_is_above: bool | None

Gets/Sets - This optional property determines whether the ruby text is printed above/left or below/right of the text.

This property is replaced by RubyPosition.

optional

Return type:

bool | None

property ruby_position: RubyPositionEnum | None

Gets/Sets - This optional property determines the position of the ruby .

optional

Returns:

Returns RubyPositionEnum or None if not supported.

Return type:

RubyPositionEnum | None

Hint

  • RubyPositionEnum can be imported from ooo.dyn.text.ruby_position

property ruby_text: str | None

Gets/Sets - This optional property contains the text that is set as ruby.

optional

Return type:

str | None

property show: bool

Gets/Sets whether the legend should be rendered by the view.

Return type:

bool

property text_user_defined_attributes: NameContainerComp | None

Gets/Sets - This property stores XML attributes.

They will be saved to and restored from automatic styles inside XML files.

When setting the value, it can be a NameContainerComp or a XNameContainer instance.

optional

Return type:

NameContainerComp | None

property unvisited_char_style_name: str | None

Gets/Sets - This optional property contains the character style name for unvisited hyperlinks.

optional

Return type:

str | None

property visited_char_style_name: str | None

Gets/Sets - This optional property contains the character style name for visited hyperlinks.

optional

Return type:

str | None