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

property for OLE chart object?

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Impress
View previous topic :: View next topic  
Author Message
a1tair
General User
General User


Joined: 05 Jun 2006
Posts: 15

PostPosted: Tue Oct 03, 2006 7:00 am    Post subject: property for OLE chart object? Reply with quote

Hi all,

I encountered with a problem and am unable to figure it out.. hope you guys can enlighten me.

I inserted a Graph into a drawpage as a OLE object. After which is there anyway i can change the type of the graph like bardiagram to xydiagram?

Also i can't seem to construct a new graph with the particular diagram type. Default is always bardiagram.

I am using Java as the sdk..

Thanks for all the help Smile
-------------------------
XShape aShape = (com.sun.star.drawing.XShape)
UnoRuntime.queryInterface(
com.sun.star.drawing.XShape.class,
aFact.createInstance("com.sun.star.drawing.OLE2Shape"));

aPage.add(aShape);
aShape.setPosition(new com.sun.star.awt.Point(1000, 1000));

aShape.setSize(new com.sun.star.awt.Size(15000,9271));


// make the OLE shape a chart

XPropertySet aShapeProp = (XPropertySet) UnoRuntime.queryInterface(

XPropertySet.class, aShape );


// set the class id for charts.
aShapeProp.setPropertyValue("CLSID", msChartClassID);


// retrieve the chart document as model of the OLE shape

aChartDoc = (XChartDocument) UnoRuntime.queryInterface(
XChartDocument.class,
aShapeProp.getPropertyValue("Model"));

XDiagram aDiagram = (XDiagram) UnoRuntime.queryInterface(

XDiagram.class, aFact.createInstance("com.sun.star.chart.XYDiagram"));


aChartDoc.setDiagram(aDiagram);

...
Back to top
View user's profile Send private message
a1tair
General User
General User


Joined: 05 Jun 2006
Posts: 15

PostPosted: Tue Oct 03, 2006 7:25 am    Post subject: (Solved) Reply with quote

Hey guys,

Sorry for the trouble. I realize if i create a xmultiservicefactory with the achartDoc it allows me to modify the graph as a graph object instead of OLE object!

Its my misjudgement.

Hope it help those who encounter the same problem.

Regards
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 Impress 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