Let's say I have a 3 column Line Up box with some display boxes, and then as a second row I have an Unlineup Box with a Graph Builder inside.
Example can be seen by running this script:
dt = New Table( "DEMO",
Add Rows( 10 ),
New Column( "Category",
Character,
"Nominal",
Set Values( {"A", "A", "A", "A", "A", "B", "B", "B", "B", "B"} )
),
New Column( "X",
Character,
"Nominal",
Set Values( {"AA", "AD", "AC", "AD", "AC", "BD", "BF", "BF", "BD", "BS"} )
),
New Column( "Y_veryLongName_toMake_Tabulat_Large",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [12, 32, 42, 23, 21, 12, 34, 53, 23, 12] )
)
);
tab = dt << Tabulate(
Show Control Panel( 0 ),
Add Table(
Column Table(
Analysis Columns( :Y_veryLongName_toMake_Tabulat_Large ),
Statistics( Sum, Mean )
),
Row Table( Grouping Columns( :Category, :X ) )
)
);
gb = dt << Graph Builder(
//Size( 528, 464 ),
Show Control Panel( 0 ),
Variables(
X( :Category ),
X( :X, Position( 1 ) ),
Y( :Y_veryLongName_toMake_Tabulat_Large ),
Color( :Category )
),
Elements( Points( X( 1 ), X( 2 ), Y, Legend( 9 ) ) )
);
rtab = tab << Report;
rgb = gb << Report;
lb = LineUp Box(NCol(3), rtab, rtab, rtab, Unlineup Box(rgb) );
nw = New Window("DEMO", Show Menu(0), Show Toolbars(0), lb);
So this is how it looks like:
Now, I want that Graph Builder to fill all the horizontal space. I don't know the size of that space, so I don't want to specify it directly, I just want it to fill all the space whatever is available.
I tried using Set Auto Stretching (1,0) on rgb, but it didn't help much.
Experimentally, I found out, that if I go to properties and change Stretching for X from Neutral to Fill for EACH AND EVERY BOX from Frame Box all the way to Outline Box, like that:
then it looks like I want it to look:
Questions:
1. Is this the only way?
2. If it is - how to script it?
Update: I guess I should be able to use XPath with ancestor-or-self (or in simpler variant just ancestor below), but I can't get it to work.
rgb << Xpath("//FrameBox/ancestor")