[Solved] Column Diagrams

Java, C++, C#, Delphi... - Using the UNO bridges
Post Reply
saleem145
Posts: 130
Joined: Mon Jul 02, 2012 4:47 pm

[Solved] Column Diagrams

Post by saleem145 »

Hello,

I enter the following data into a spreadsheet

Audi 10
Mercedes 100
Porsche 5
VW 200
BMW 150

Make a Column Chart. The xlabels are set to Audi, Mercedes.... and there are neat bars. All is good.

Now enter the following data

1 10
2 100
3 5
4 200
5 150

Instead of using the first columns as xlabels, it plots two series of bars?? How can I force it to use the first series as xlabels??

And now how can I do this programatically. I am creating an instance of "com.sun.star.chart.ColumnDiagram". How do I specify the xlabels and the heights programatically. If I just call setData and pass in a 2D array it assumes there are two series of points and plots two series of bars.

Thanks,

Saleem
Last edited by RoryOF on Thu Aug 02, 2012 6:13 pm, edited 1 time in total.
Reason: Added green tick [RoryOF, Moderator]
OpenOffice 3.4.0
Mac OS X 10.5.8
saleem145
Posts: 130
Joined: Mon Jul 02, 2012 4:47 pm

Re: [Solved] Column Diagrams

Post by saleem145 »

chartData = chartDoc.getData()
chartData.setRowDescriptions(tuple(centers))

does the trick. Thanks.
OpenOffice 3.4.0
Mac OS X 10.5.8
Post Reply