Setting data in Writer chart from Basic

Regina Henschel rb.henschel at t-online.de
Sun Jan 24 10:14:05 PST 2016


Hi Jan,

it might work for you as
oXCOEO = xChart.ExtendedControlOverEmbeddedObject
oXCOEO.update()

If you sent me a document including the macro and the chart, I can try it.

Or you try it with event, as described here 
https://forum.openoffice.org/en/forum/viewtopic.php?f=45&t=28327

It is a typical question for a forum.

Kind regards
Regina


Jan Rheinländer schrieb:
> Hi,
>
> with this code I can change the data in a Writer chart:
>
>      set doc = thisComponent
>      set ctrl = thisComponent.CurrentController
>      xChart = ctrl.getModel().getEmbeddedObjects.getByName("Objekt1")
>      set cDoc = xChart.getEmbeddedObject
>      set cDataArray = cDoc.getDataProvider
>      data = cDataArray.getData
>      ' Do something with the data
>      cDataArray.setData(data)
>
> But I can't get the chart to update. The only way I see is to
> double-click on the chart in the document, then it will update.
>
> What is the right way to force an update via code?
>
> Thank!
>      Jan
>
> _______________________________________________
> LibreOffice mailing list
> LibreOffice at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/libreoffice
>



More information about the LibreOffice mailing list