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

Generating chart

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


Joined: 25 Apr 2005
Posts: 32

PostPosted: Thu Aug 31, 2006 12:58 am    Post subject: Generating chart Reply with quote

Hi all,

I have generated chart into Microsoft Excel using Open Office and Java.
One chart took 20 seconds to be generated. It was very time-consuming if there was a lot of charts.

Below code are the most time-consuming part during execution and are used to set the name for x-axis and y-axis and also the positioning of the scale value.

Is there a better way to set the axes using Open Office and Java ? Or is there a better way to generate charts in Java?



XAxisXSupplier xAxis = (XAxisXSupplier)UnoRuntime.queryInterface(XAxisXSupplier.class, xdiagram);

if (xAxis != null) {
xShape = xAxis.getXAxisTitle();
xPropSet = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, xShape);
xPropSet.setPropertyValue("String", new String(sXAxis));
xPropSet.setPropertyValue("CharHeight", new Float(fontSize));
xPropSet.setPropertyValue("CharWeight", new Float(com.sun.star.awt.FontWeight.BOLD));

xPropSet = xAxis.getXAxis();
xPropSet.setPropertyValue("Min", new Double(0));
xPropSet.setPropertyValue("Max", new Double(max));
xPropSet.setPropertyValue("StepMain", new Double(1));
xPropSet.setPropertyValue("CharHeight", new Float(fontSize));

xPropSet.setPropertyValue("TextRotation", new Integer(iXDegree));
xPropSet.setPropertyValue("TextBreak", new Boolean(true));
xPropSet.setPropertyValue("Overlap", new Long(0L));
xPropSet.setPropertyValue("TextCanOverlap", new Boolean(true));

}
XAxisYSupplier yAxis = (XAxisYSupplier)UnoRuntime.queryInterface(XAxisYSupplier.class, xdiagram);

if (yAxis != null) {

xShape = yAxis.getYAxisTitle();
xPropSet = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, xShape);
xPropSet.setPropertyValue("String", new String(sYAxis));
xPropSet.setPropertyValue("CharHeight", new Float(fontSize));
xPropSet.setPropertyValue("CharWeight", new Float(com.sun.star.awt.FontWeight.BOLD));
xPropSet = yAxis.getYAxis();
xPropSet.setPropertyValue("Min", new Double(0));
xPropSet.setPropertyValue("Max", new Double(max));
xPropSet.setPropertyValue("StepMain", new Double(step));
xPropSet.setPropertyValue("CharHeight", new Double(charHeight));
xPropSet.setPropertyValue("TextRotation", new Integer(iYDegree));
xPropSet.setPropertyValue("TextBreak", new Boolean(true));
xPropSet.setPropertyValue("TextCanOverlap", new Boolean(true));
}

Thanks for the help
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