Page 1 of 1

[Solved] Change diagram wall's size and position (Java)

Posted: Fri Dec 25, 2015 10:48 am
by genglz
Hi, I am using java to handle msword97 documents and embedded charts.
I need to change diagram wall's size and position.
How to change the diagram wall's size and position
How to change the 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
The second test code:

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)));     
Is there any solutions?
Thanks.

Re: how to change diagram wall's size and position(Java)

Posted: Fri Dec 25, 2015 2:13 pm
by Villeroy
All the other objects, x/y/z-axis, floor (whatever that is) have position and size. May be the wall size depends on these.

Re: How to change diagram wall's size and position(Java)

Posted: Wed Jan 20, 2016 10:02 am
by genglz
I has resolved this by setting the RelativePosition and RelativeSize properties of chart2.XDiagram.