rospcc General User

Joined: 25 Apr 2005 Posts: 32
|
Posted: Thu Aug 31, 2006 12:58 am Post subject: Generating chart |
|
|
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 |
|