Class DataSource

class ooodev.calc.chart2.data.data_source.DataSource(owner, component, lo_inst=None)[source]

Bases: LoInstPropsPartial, DataSourceComp, ChartDocPropPartial

Class for managing Chart2 Data Data Source.

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

Constructor

Parameters:
  • owner (ChartDiagram) – Chart Diagram.

  • component (XDataSource) – UNO object that implements XDataSource interface.

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

Return type:

None

get_data(idx)[source]

Get Data

Parameters:

idx (int) – Index.

Raises:
  • IndexError – If index is out of range.

  • ChartError – If any other error occurs.

Returns:

float.

Return type:

Tuple[Tuple, …]

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

property chart_doc: ChartDoc

Chart Document.

Return type:

ChartDoc

property component: com.sun.star.chart2.data.DataSource

DataSource Component

Return type:

DataSource

property lo_inst: LoInst

Lo Instance

Return type:

LoInst

property owner: ChartDataSeries

Chart Diagram

Return type:

ChartDataSeries