Joined: 13 Sep 2005
|Posted: Thu Oct 06, 2005 6:07 am Post subject: Change data of a chart by Delphi
|I want to change the data of a chart. I know already how to retrieve the data from a chart but if I want to set the data i run into trouble.
This is the code I found at the OOo sdk but I can't converted to Delphi.
' create data with dimensions 2 x 3
' 2 is called outer dimension and 3 inner dimension
' assume that oChartDocument contains a valid
Dim oData As Object
Dim oDataArray( 0 To 1 ) As Object
Dim oSeries1( 0 To 2 ) As Double
Dim oSeries2( 0 To 2 ) As Double
oSeries1( 0 ) = 3.141
oSeries1( 1 ) = 2.718
oSeries1( 2 ) = 1.0
oSeries2( 0 ) = 17.0
oSeries2( 1 ) = 23.0
oSeries2( 2 ) = 42.0
oDataArray( 0 ) = oSeries1()
oDataArray( 1 ) = oSeries2()
' call getData() method of XChartDocument to get the XChartDataArray
oData = oChartDocument.Data
' call setData() method of XChartDataArray to apply the data
oData.Data = oDataArray()
' Note: to use the series arrays here as values for the series in the chart
' you have to set the DataRowSource of the XDiagram object to
' com.sun.star.chart.ChartDataRowSource.ROWS (default is COLUMNS)
Is there anybody how can help me converting this code to a valid Delphi syntax.
The problem occurs when I want to assign the oSeries to oDataArray. Delphi gives me a compiler error "incompitble types"