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

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
genglz
Posts: 2
Joined: Mon Dec 14, 2015 5:21 am

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

Post 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.
Last edited by genglz on Wed Jan 20, 2016 10:04 am, edited 2 times in total.
openoffice4.1.2,win7
User avatar
Villeroy
Volunteer
Posts: 31363
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

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

Post 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.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
genglz
Posts: 2
Joined: Mon Dec 14, 2015 5:21 am

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

Post by genglz »

I has resolved this by setting the RelativePosition and RelativeSize properties of chart2.XDiagram.
openoffice4.1.2,win7
Post Reply