Class ChartDataSeries
- class ooodev.calc.chart2.chart_data_series.ChartDataSeries(owner, chart_doc, component=None, lo_inst=None)[source]
Bases:
Generic
[_T
],LoInstPropsPartial
,DataSeriesComp
,ChartDocPropPartial
,PropPartial
,QiPartial
,ServicePartial
,TheDictionaryPartial
,CalcDocPropPartial
,CalcSheetPropPartial
,StylePartial
,FontEffectsPartial
,FontOnlyPartial
,FontPartial
,NumbersNumbersPartial
,FillColorPartial
,ChartFillGradientPartial
,ChartFillHatchPartial
,ChartFillImgPartial
,ChartFillPatternPartial
,BorderLinePropertiesPartial
,TransparencyPartial
,GradientPartial
,DataLabelBorderPartial
,Chart2DataLabelTextAttributePartial
,Chart2DataLabelAttribOptPartial
,Chart2DataLabelPercentFormatPartial
,Chart2DataLabelOrientationPartial
Class for managing Chart2 Chart Title Component.
- __getitem__(key)[source]
Gets the data point at the specified index.
- Parameters:
key (int) – The index. When getting by index can be a negative value to get from the end.
- Returns:
The sheet with the specified index or name.
- Return type:
- 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 ofcom.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 acom.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 UNOcom.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 acom.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 UNOcom.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
- apply_styles(*styles, **kwargs)
Applies style to component.
- Parameters:
obj. (styles expandable list of styles object such as Font to apply to) –
kwargs (Any, optional) – Expandable list of key value pairs.
styles (StyleT) –
- 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_data_point_by_index(idx)[source]
Gets a data point by index.
- Parameters:
idx (int) – Index of data point. Can be a negative value to index from the end of the list.
- Raises:
IndexError – If index is out of range.
- Return type:
- get_data_points()[source]
” Gets all the data points of the series.
- Returns:
List of data points.
- Return type:
List[ChartDataPoint]
- get_data_sequences()
Returns data sequences.
If the data stored consist only of floating point numbers (double values), the returned instances should also support the service NumericalDataSequence.
If the data stored consist only of strings, the returned instances should also support the service TextualDataSequence.
- Return type:
Tuple
[XLabeledDataSequence
,...
]
- get_data_source()[source]
Get data source of a chart for a given chart type.
- Raises:
ChartError – If any error occurs.
- Returns:
Chart data source
- Return type:
- 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 beNone
.
- 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
- reset_all_data_points()
all data point formatting are cleared
- Return type:
None
- reset_data_point(idx)
the formatting of the specified data point is cleared
- Return type:
None
- Parameters:
idx (int) –
- set_data(data)
Sets new data sequences.
The elements set here must support the service DataSequence.
If the data consist only of floating point numbers (double values), the instances set here should also support the service NumericalDataSequence.
If the data consist only of strings, the instances set here should also support the service TextualDataSequence.
If one of the derived services is supported by one element of the sequence, it should be available for all elements in the sequence.
- Return type:
None
- Parameters:
data (Tuple[com.sun.star.chart2.data.XLabeledDataSequence, ...]) –
- set_data_point_labels(label_type)[source]
Set data point labels for a given chart type.
- Parameters:
label_type (DataPointLabelTypeKind) – Data point label type.
- Raises:
ChartError – If any error occurs.
- Return type:
None
Hint
DataPointLabelTypeKind
can be imported fromooodev.utils.kind.data_point_label_type_kind
- 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 toStandardColor.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
andRECT
style gradients. Defaults toOffset(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 fromooo.dyn.awt.gradient_style
Angle
can be imported fromooodev.units
ColorRange
can be imported fromooodev.utils.data_type.color_range
Intensity
can be imported fromooodev.utils.data_type.intensity
IntensityRange
can be imported fromooodev.utils.data_type.intensity_range
Offset
can be imported fromooodev.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:
Hint
PresetGradientKind
can be imported fromooodev.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. Default0
.space (float, UnitT, optional) – Specifies the space between the lines in the hatch (in
mm
units) or Class UnitT. Default0.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 fromooodev.units
HatchStyle
can be imported fromooo.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
ifbefore_style_area_hatch_from_preset
event is cancelled.- Return type:
ChartFillHatchT | None
Hint
PresetHatchKind
can be imported fromooodev.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 inmm
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 toFalse
.
- 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 fromooo.dyn.drawing.rectangle_point
ImgStyleKind
can be imported fromooodev.format.inner.direct.write.fill.area.img
SizePercent
can be imported fromooodev.format.inner.common.format_types.size_percent
SizeMM
can be imported fromooodev.utils.data_type.size_mm
OffsetColumn
can be imported fromooodev.format.inner.common.format_types.offset_column
OffsetRow
can be imported fromooodev.format.inner.common.format_types.offset_row
Offset
can be imported fromooodev.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:
Hint
PresetImageKind
can be imported fromooodev.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 toFalse
.
- 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:
Hint
PresetPatternKind
can be imported fromooodev.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
andRECT
style gradients. Defaults toOffset(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 fromooo.dyn.awt.gradient_style
IntensityRange
can be imported fromooodev.utils.data_type.intensity_range
Offset
can be imported fromooodev.utils.data_type.offset
Angle
can be imported fromooodev.units
Intensity
can be imported fromooodev.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
to100
.- 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 fromooodev.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
andAttribOptions
can be imported fromooodev.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 to0
.transparency (int | Intensity, optional) – Line transparency from
0
to100
. Defaults to0
.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 fromooodev.format.inner.preset.preset_border_line
Intensity
can be imported fromooodev.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:
- 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
- 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
to100
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 fromooo.dyn.style.case_map
FontReliefEnum
can be imported fromooo.dyn.awt.font_relief
FontStrikeoutEnum
can be imported fromooo.dyn.awt.font_strikeout
FontLine
can be imported fromooodev.format.inner.direct.write.char.font.font_effects
Intensity
can be imported fromooodev.utils.data_type.intensity
FontUnderlineEnum
can be imported fromooo.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 fromooo.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 fromooo.dyn.awt.font_family
CharSetEnum
can be imported fromooo.dyn.awt.char_set
ShadowFormat
can be imported fromooo.dyn.table.shadow_format
FontSlant
can be imported fromooo.dyn.awt.font_slant
FontStrikeoutEnum
can be imported fromooo.dyn.awt.font_strikeout
FontWeightEnum
can be imported fromooo.dyn.awt.font_weight
FontLine
can be imported fromooodev.format.inner.direct.write.char.font.font_effects
CharSpacingKind
can be imported fromooodev.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 to0
.transparency (int | Intensity, optional) – Line transparency from
0
to100
. Defaults to0
.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 fromooodev.format.inner.preset.preset_border_line
Intensity
can be imported fromooodev.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 fromooo.dyn.lang.locale
NumberFormatEnum
can be imported fromooo.dyn.util.number_format
NumberFormatIndexEnum
can be imported fromooo.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 toFalse
.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 fromooo.dyn.util.number_format
NumberFormatIndexEnum
can be imported fromooo.dyn.i18n.number_format_index
PercentFormat
can be imported fromooodev.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 fromooodev.units
DirectionModeKind
can be imported fromooodev.format.inner.direct.chart2.title.alignment.direction
Orientation
can be imported fromooodev.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 toFalse
.show_number_in_percent (bool, optional) – Only effective, if
ShowNumber
isTrue
. If this member is alsoTrue
, 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 toFalse
.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 toFalse
.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 toFalse
.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 thecom.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 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 isDEFAULT_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 theline_color
property.- Return type:
NewType()
(Color
,int
)
- property component: com.sun.star.chart2.DataSeries
DataSeries Component
- Return type:
DataSeries
- 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 serviceErrorBar
.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 events_listener_properties_change_implement: PropertiesChangeListener
Returns listener
- Return type:
- property extra_data: TheDict
Extra Data Key Value Pair Dictionary.
Properties can be assigned properties and access like a dictionary and with dot notation.
Note
This is a dictionary object that can be used to store key value pairs. Generally speaking this data is not part of the object’s main data structure and is not saved with the object (document).
This property is used to store data that is not part of the object’s main data structure and can be used however the developer sees fit.
- Return type:
- 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 toFillStyle.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 propertiesfill_bitmap_size_x
andfill_bitmap_size_y
contain the size of the tile in percent of the size of the original bitmap. If this isFalse
, the size of the tile is specified with1/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 thefill_bitmap_mode
property changes toBitmapMode.STRETCH
. BUT: behavior is undefined, if the propertyfill_bitmap_tile
isTrue
too.If set to
False
, the value of thefill_bitmap_mode
property changes toBitmapMode.REPEAT
orBitmapMode.NO_REPEAT
, depending on the current value of thefill_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 thefill_bitmap_mode
property changes toBitmapMode.REPEAT
. BUT: behavior is undefined, if the propertyfill_bitmap_stretch
isTrue
too.If set to
False
, the value of thefill_bitmap_mode
property changes toBitmapMode.STRETCH
orBitmapMode.NO_REPEAT
, depending on the current value of thefill_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 toFillStyle.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 toFillStyle.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 toFillStyle.GRADIENT
, this describes the gradient used.Note when setting the gradient it can be a
GradientStructComp
or aGradient
struct.optional
- Returns:
Gradient Struct Component or None if not supported.
- Return type:
GradientStructComp | None
Hint
Gradient
can be imported fromooo.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 toFillStyle.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 toFillStyle.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 toFillStyle.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 toFillStyle.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 aGradient
struct.optional
- Returns:
Gradient Struct Component or None if not supported.
- Return type:
GradientStructComp | None
Hint
Gradient
can be imported fromooo.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
, andfill_style
isFillStyle.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_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 toBitmapMode.STRETCH
, this is the cropping, otherwise it is empty.When setting the cropping it can be a
GraphicCropStructComp
or aGraphicCrop
struct.optional
- Returns:
Graphic Crop Struct Component or None if not supported.
- Return type:
GraphicCropStructComp | None
Hint
GraphicCrop
can be imported fromooo.dyn.text.graphic_crop
.
- 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 thecom.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 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:
- 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: _T
Owner
- Return type:
TypeVar
(_T
, bound= ComponentT)
- property percent_diagonal: int | None
Gets/Seta a value between
0
and100
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
anderror_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