Hi,
I know how to create a chart with multiple data series in Calc 2.3.
But I've not been able to figure out how to do it within OOo Basic.
Any ideas?
Thank you.
[Solved] Multiple data series
[Solved] Multiple data series
Last edited by ptsenter on Tue May 27, 2008 7:23 pm, edited 1 time in total.
Re: multiple data series
Search this forum for xray. Install it. Browse the collection of charts on a single spreasheet.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: multiple data series
Your post implies that you know how to do this with one data series... Is this correct?
http://www.oooforum.org/forum/viewtopic ... ight=chart
http://www.oooforum.org/forum/viewtopic ... ight=chart
[Solved]Re: multiple data series
Thank you, guys, for your responses. I'm sure I'll use Xray in the future. But I found two pretty simple solutions
(I actually need XY-diagram):
1. Fill cells like the following and select entire range
x aa bb cc
1 5
2 7
3 8
5 4
7 6
2 6 second number in this line and next three under header bb
4 4
6 7
8 8
1 3 second number in this line and next three under header cc
2 2
5 4
8 5
2. There is an example in Developer's Guide. p.748 (May 2005 edition, so to speak)
I would mark my question as solved if I knew how to do it.
Thanx again.
(I actually need XY-diagram):
1. Fill cells like the following and select entire range
x aa bb cc
1 5
2 7
3 8
5 4
7 6
2 6 second number in this line and next three under header bb
4 4
6 7
8 8
1 3 second number in this line and next three under header cc
2 2
5 4
8 5
2. There is an example in Developer's Guide. p.748 (May 2005 edition, so to speak)
I would mark my question as solved if I knew how to do it.
Thanx again.
Last edited by ptsenter on Tue May 27, 2008 9:15 pm, edited 3 times in total.
Re: multiple data series
While beeing logged in, visit this thread, push theI would mark my question as solved if I knew how to do it.
Edit: button and add [Solved] to the subject line. |
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: [Solved]multiple data series
Apparently, solution 2 is too cumbersome.
Re: [Solved]multiple data series
There are no simple OOo macros.ptsenter wrote:Apparently, solution 2 is too cumbersome.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: [Solved]multiple data series
Code: Select all
Sub CreateChart
Dim oSheet 'Sheet containing the chart
Dim oRect 'How big is the chart
Dim oCharts 'Charts in the sheet
Dim oChart 'Created chart
Dim oAddress 'Address of data to plot
Dim sName$ 'Chart name
Dim oChartDoc 'Embedded chart object
Dim oTitle 'Chart title object
Dim oDiagram 'Inserted diagram (data).
Dim sDataRng$ 'Where is the data
sName = "ADP_Chart"
sDataRng = "A1:D6"
'sDataRng = "A33:D38"
oSheet = ThisComponent.sheets(0)
oAddress = oSheet.getCellRangeByName( sDataRng ).getRangeAddress()
oCharts = oSheet.getCharts()
If NOT oCharts.hasByName(sName) Then
oRect = createObject("com.sun.star.awt.Rectangle")
oRect.X = 10000
oRect.Y = 1000
oRect.width = 10000
oRect.Height= 10000
' The rectangle identifies the dimensions in 1/100 mm.
' The address is the location of the data.
' True indicates that column headings should be used.
' False indicates that Row headings should not be used.
oCharts.addNewByName(sName, oRect, Array(oAddress), True, False)
End If
oChart = oCharts.getByName( sName )
oChart.setRanges(Array(oAddress))
oChartDoc = oChart.getEmbeddedObject()
'oChartDoc.attachData(oAddress)
oTitle = oChartDoc.getTitle()
oTitle.String = "Andy - " & Now
' Create a diagram.
oDiagram = oChartDoc.createInstance( "com.sun.star.chart.LineDiagram" )
oChartDoc.setDiagram( oDiagram )
oDiagram = oChartDoc.getDiagram()
oDiagram.DataCaption = com.sun.star.chart.ChartDataCaption.VALUE
oDiagram.DataRowSource = com.sun.star.chart.ChartDataRowSource.COLUMNS
End Sub