Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi Steve,

Insert as you have done as object. Add a series and the x column will
be present. The chart is created with some demo data, delete these
series.

thanks, that works fine.

But what I am really trying to do is to write a Macro to create a
XY-Chart. See below. Whatever data I pass to setData() I never succeed
in getting an X-Column. Is this a bug in the API? There is no method to
simply clear out the example data, either.

Sub Main
    xTC =
ThisComponent.createInstance("com.sun.star.text.TextEmbeddedObject")
    xTC.CLSID = "12dcae26-281f-416f-a234-c3086127382e"
    xText = ThisComponent.getText()
    cursor = xText.createTextCursor()
    xText.insertTextContent(cursor, xTC, 0)
    chart = xTC.getEmbeddedObject()
    diagram = chart.createInstance("com.sun.star.chart.XYDiagram")
    chart.setDiagram(diagram)
    data = chart.getData()
    Dim cdata(1,1)
    data.setData(cdata)
End Sub

Jan

-- 
For unsubscribe instructions e-mail to: users+help@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.