[Solved] Change diagram wall's size and position (Java)
Posted: Fri Dec 25, 2015 10:48 am
Hi, I am using java to handle msword97 documents and embedded charts.
I need to change diagram wall's size and position. The first test code:
The second test code:
Is there any solutions?
Thanks.
I need to change diagram wall's size and position. The first test code:
Code: Select all
// I'm using ridl-3.2.1.jar、juh-3.2.1.jar、unoil-3.2.1.jar、jurt-3.2.1.jar
// xChartDoc is a XChartDocument, embedded in writer.
XPropertySet aWall = ((X3DDisplay) UnoRuntime.queryInterface(X3DDisplay.class, xChartDoc.getDiagram())).getWall();
// there is no property to change wall's size and position
Code: Select all
XDrawPageSupplier xDrawPageSupplier = (XDrawPageSupplier)
UnoRuntime.queryInterface (XDrawPageSupplier.class, xChartDoc );
// Get the XShapes interface of the draw page
XShapes xShapes = ( XShapes ) UnoRuntime.queryInterface (
XShapes.class, xDrawPageSupplier.getDrawPage () );
// shape from xShapes and set it's position and size, but have no effect.
shp1.setPosition(new Point((int)(10.8 * 100), (int)(1.6 * 100)));
shp1.setSize(new Size((int)(20.0 * 100), (int)(20.0 * 100)));
Thanks.