Hi,

after doing XChartDataArray setData(), what must I do to let the GUI update the chart with the newly set data?

For example, if my document contains a chart called "Objekt80", then running the following macro changes the chart series data, but the chart doesn't update to display the change.

Sub Main
    objs =  ThisComponent.getEmbeddedObjects()

    for i = 0 to objs.count - 1
        obj = objs(i)

        if (obj.Name = "Objekt80") then
            oChart = obj.Component
            oDataProvider = oChart.DataProvider
            oData = oDataProvider.Data

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

            oDataProvider.Data = oDataArray()
        EndIf
    Next i
End Sub

Thanks for any hints,
Jan Rheinländer

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Reply via email to