OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

How to... how to get a chart type in an existing chart

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
xconeis2
Newbie
Newbie


Joined: 15 May 2009
Posts: 2

PostPosted: Fri May 15, 2009 9:55 am    Post subject: How to... how to get a chart type in an existing chart Reply with quote

Hello:

I have a spreedsheet with a charts, i need to now what type of chatrs is it... whit a macro.

I have this macros but it's not correct:
Sub oHojas_1
Dim oDoc As Object
Dim oHoja As Object
Dim oGrafico As Object
Dim oGrafico2 As Object
Dim oValor As String

oDoc = StarDesktop.CurrentComponent
oHoja = oDoc.Sheets(0)
oGrafico = oHoja.Charts
oGrafico2 = oGrafico.getByIndex(0)
oValor = oGrafico.getDiagramType(oGrafico2)
MsgBox oValor



end sub
Back to top
View user's profile Send private message
ms777
Super User
Super User


Joined: 07 Feb 2004
Posts: 1355

PostPosted: Tue May 19, 2009 2:07 pm    Post subject: Reply with quote

Hi,

the below code works in OO 3.1 for a bar chart with two data series

Good luck,

ms777

Code:
Sub Main
oSheet = ThisComponent.sheets.getByIndex(0)
oChart = oSheet.Charts.getByIndex(0)
oCoordSys = oChart.EmbeddedObject.FirstDiagram.CoordinateSystems(0)

msgbox oCoordSys.ChartTypes(0).ChartType
End Sub
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group