Class TableChart

class ooodev.calc.chart2.table_chart.TableChart(owner, component, lo_inst=None)[source]

Bases: LoInstPropsPartial, TableChartComp, EventsPartial, PropPartial, QiPartial, ServicePartial, TheDictionaryPartial, PropertyChangeImplement, VetoableChangeImplement, CalcSheetPropPartial, CalcDocPropPartial

Class for managing table Chart.

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

Constructor

Parameters:
  • component (XTableChart) – UNO Component that supports com.sun.star.table.TableChart service.

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

  • owner (CalcSheet) –

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

copy_chart()[source]

Copies the chart to the clipboard using a dispatch command.

Raises:

ChartError – If error occurs.

Return type:

None

get_embedded_object()

returns the object which is embedded into this object.

Return type:

XComponent

get_has_column_headers()

Returns, whether the cells of the topmost row of the source data are interpreted as column headers.

Return type:

bool

get_has_row_headers()

Returns, whether the cells of the leftmost column of the source data are interpreted as row headers.

Return type:

bool

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_ranges()

Returns the cell ranges that contain the data for the chart.

Return type:

Tuple[CellRangeAddress, ...]

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

set_has_column_headers(has_column_headers)

Specifies whether the cells of the topmost row of the source data are interpreted as column headers.

Return type:

None

Parameters:

has_column_headers (bool) –

set_has_row_headers(has_row_headers)

Specifies whether the cells of the leftmost column of the source data are interpreted as row headers.

Return type:

None

Parameters:

has_row_headers (bool) –

set_property(**kwargs)

Set property value

Parameters:

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

Return type:

None

set_ranges(ranges)

Sets the cell ranges that contain the data for the chart.

Return type:

None

Parameters:

ranges (Tuple[CellRangeAddress, ...]) –

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 calc_doc: CalcDoc

Calc Document.

Return type:

CalcDoc

property calc_sheet: CalcSheet

Calc Sheet.

Return type:

CalcSheet

property chart_doc: ChartDoc

Chart Document.

Return type:

ChartDoc

property component: com.sun.star.table.TableChart

TableChart Component

Return type:

TableChart

property draw_page: ChartDrawPage

Draw Page.

Return type:

ChartDrawPage

property event_observer: EventObserver

Gets/Sets The Event Observer for this instance.

Return type:

EventObserver

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:

TheDict

property lo_inst: LoInst

Lo Instance

Return type:

LoInst

property name: str

Name of the chart.

Return type:

str

property office_doc: OfficeDocumentT

Office Document.

Return type:

OfficeDocumentT

property shape: ChartShape

OLE2 Shape.

Return type:

ChartShape