[Solved] set Wall size for Chart in Calc

Keyboard macros or custom scripts

[Solved] set Wall size for Chart in Calc

Postby misitu » Thu Jun 23, 2016 11:37 pm

Hello...
I have two diagrams, one with cubic and the other with B splines. Am trying to compare them by flicking back and forward in the PDF export of the Sheet.

If I have the legend at the bottom, there is no problem, but I like to have it on the right and for some reason, possibly connected with the line type, one diagram is wider than the other.

So I thought I would tweak the Wall.Width, which can be done manually, from the API.

I have had a serious look round the Wiki, IDL, and this forum, and also had a poke with xray, but can't see anything obvious by the way of setting the width of the Wall.

It's not a "deal breaker" but if it IS there to be used I would love to know, and it would also help me to make my own mental map of the API which is still (tbh) a bit of a battle. :oops:

Thanks in advance for any hints, etc.
Best regards
David
Last edited by misitu on Fri Jun 24, 2016 6:14 pm, edited 1 time in total.
OpenOffice 4.1.1
HSQLDB 2.3.4
Windows 7 HP / Windows 10
OOBasic
User avatar
misitu
 
Posts: 89
Joined: Mon Dec 16, 2013 5:34 am
Location: Trujillo - La Libertad - Perú

Re: set Wall size for Chart in Calc

Postby FJCC » Fri Jun 24, 2016 3:16 am

I recorded this code with MRI. It resizes the diagram of a graph on the first sheet.
Code: Select all   Expand viewCollapse view
oSheets = ThisComponent.getSheets()
  oObj1 = oSheets.getByIndex(0)
  oCharts = oObj1.getCharts()
 
  oObj2 = oCharts.getByIndex(0)
  oEmbeddedObject = oObj2.getEmbeddedObject()
  oDiagram = oEmbeddedObject.getDiagram()
  aSize4 = oDiagram.getSize()
  aSize4.Width = aSize4.Width * 0.8
  oDiagram.Size = aSize4
AOO 3.4 or 4.1 on MS Windows XP ( before 2013-08-03) or Windows 7
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
FJCC
Moderator
 
Posts: 6761
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: set Wall size for Chart in Calc

Postby misitu » Fri Jun 24, 2016 6:14 pm

Cheers!

as I wanted both diagrams of identical size, after playing about with different multiplications, and checking the wall dimensions as generated, I just did this:
Code: Select all   Expand viewCollapse view
aSize = oDiagram.getSize()
aSize.Width = 12860
aSize.Height = 8660
oDiagram.Size = aSize

for both diagrams..
PERFECT.

At least I have what I was looking for, and know a bit about fixing the Wall size.

Many thanks
Best regards
David
OpenOffice 4.1.1
HSQLDB 2.3.4
Windows 7 HP / Windows 10
OOBasic
User avatar
misitu
 
Posts: 89
Joined: Mon Dec 16, 2013 5:34 am
Location: Trujillo - La Libertad - Perú


Return to OpenOffice Basic, Python, BeanShell, JavaScript

Who is online

Users browsing this forum: No registered users and 5 guests