Hi i am new to libre office, currently, i am working on a chart generation task.
I want to use row as data series, please check the attchment.
But how can i do it in code like C#?
How to set data series in rows programmingly?
How to set data series in rows programmingly?
- Attachments
-
- Capture.PNG (9.26 KiB) Viewed 794 times
OpenOffice 7.3 on Windows 10
Re: How to set data series in rows programmingly?
Here is some OpenOffice Basic code that makes a chart with two data series in the range C2:I8 on the first sheet.
Code: Select all
Dim RangeAddress(0) As New com.sun.star.table.CellRangeAddress
Dim Rect As New com.sun.star.awt.Rectangle
Rect.X = 100
Rect.Y = 200
Rect.Width = 18000
Rect.Height = 9000
RangeAddress(0).Sheet = 0
RangeAddress(0).StartColumn = 2
RangeAddress(0).StartRow = 1
RangeAddress(0).EndColumn = 8
RangeAddress(0).EndRow = 2
oSheet = ThisComponent.Sheets.getByIndex(0)
Charts = oSheet.Charts
Charts.addNewByName("MyChart", Rect, RangeAddress(), False, False)
Chart = Charts.getByName("MyChart").EmbeddedObject
Chart.Diagram.DataRowSource = com.sun.star.chart.ChartDataRowSource.ROWS
Chart.Diagram = Chart.createInstance("com.sun.star.chart.LineDiagram")
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.