1. You need to read the Scripting Guide so that you understand how the Display Tree Structures work, which will allow you to interpret what the sample code I provided is doing.
2. Below is a modification to the code that you provided. In your example, what should have happened, is that a separate window should have appeared with the framebox from the Graph Builder in it, sans the outline box. The new code places that frame box into the new window that you are creating.
Y_Graph = Expr(
//For(k=1,k<=N Items(Act),k++,(
k = 7;
ybuild = Yield_Tab << Graph Builder(
Size( 639, 378 ),
Show Control Panel( 0 ),
Show Footer( 0 ),
Lock Scales( 1 ),
Variables(
X( :Month ),
X( :WW ),
Y( Column( Act[k] ) ),
Y( Column( Act[k] || " Weekly Target" ), Position( 1 ) ),
Y( Column( Act[k] || " Month Target" ), Position( 1 ) )
),
Relative Sizes( "X", [197 397] ),
Elements(
Position( 1, 1 ),
Line(
X,
Y( 1 ),
Y( 3 ),
Legend( 6 ),
Smoothness( 0.5 ),
Missing Values( "No Connection" )
),
Bar( X, Y( 1 ), Legend( 12 ), Label( "Label by Value" ) ),
Points( X, Y( 1 ), Y( 3 ), Legend( 16 ), Jitter( 0 ), Summary Statistic( "Mean" ) )
),
Elements(
Position( 2, 1 ),
Line( X, Y( 1 ), Y( 2 ), Legend( 7 ), Missing Values( "No Connection" ) ),
Bar( X, Y( 1 ), Legend( 13 ), Label( "Label by Value" ) ),
Points( X, Y( 1 ), Y( 2 ), Legend( 17 ), Jitter( 0 ), Summary Statistic( "Mean" ) )
),
SendToReport(
Dispatch( {}, "Month", ScaleBox ),
Dispatch( {}, "WW", ScaleBox ),
Dispatch(
{},
Act[k],
ScaleBox,
{Min( Eval( minl[k] ) ), Max( Eval( maxl[k] ) ), Inc( 5 ), Minor Ticks( 1 ),
Label Row( {Show Major Grid( 1 ), Show Minor Grid( 1 )} )}
),
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
6,
Level Name( 0, "Yield" ),
Level Name( 1, "Ultimate Yield" ),
Properties(
1,
{Line Color( 20 ), Line Style( "Dotted" ),
gradient( {Scale Values( [0 1] ), Width( 9 ), N Labels( 6 )} )}
)
), Legend Model(
12,
Properties(
0,
{Fill Color( 2 ), Transparency( 0 ),
gradient( {Scale Values( [0 1] ), Width( 9 ), N Labels( 6 )} )}
)
), Legend Model(
16,
Base( 0, 0, 0 ),
Base( 1, 0, 0 ),
Properties(
0,
{Line Color( 0 ), gradient(
{Scale Values( [0 1] ), Width( 9 ), N Labels( 6 )}
)}
),
Properties(
1,
{Line Color( 0 ), gradient(
{Scale Values( [0 1] ), Width( 9 ), N Labels( 6 )}
)}
)
), Legend Model(
7,
Base( 0, 0, 0 ),
Properties(
0,
{Line Color( 21 ), gradient(
{Scale Values( [0 1] ), Width( 9 ), N Labels( 6 )}
)}
),
Properties(
1,
{Line Color( 20 ), Line Style( "Dotted" ),
gradient( {Scale Values( [0 1] ), Width( 9 ), N Labels( 6 )} )}
)
), Legend Model(
13,
Properties(
0,
{Fill Color( 2 ), Transparency( 0 ),
gradient( {Scale Values( [0 1] ), Width( 9 ), N Labels( 6 )} )}
)
), Legend Model(
17,
Base( 0, 0, 0 ),
Base( 1, 0, 1 ),
Properties(
0,
{Line Color( 0 ), gradient(
{Scale Values( [0 1] ), Width( 9 ), N Labels( 6 )}
)}
),
Properties(
1,
{Line Color( 0 ), gradient( {Scale Values( [0 1] ), N Labels( 6 )} )}
)
)}
),
Dispatch(
{},
"graph title",
TextEditBox,
{Set Text( Top_products[x] || " " || Act[k] )}
),
Dispatch( {}, "Y title", TextEditBox, {Set Text( Act[k] )} ),
Dispatch( {}, "X 1 title", TextEditBox, {Set Text( "Work Week" )} ),
Dispatch(
{},
"400",
LegendBox,
{Set Title( "" ), Legend Position(
{6, [0, 1], 12, [-1], 16, [-1, -1], 7, [-1, -1], 13, [-1], 17, [-1, -1]}
), Position( {0, 1, -1, -1, -1, -1, -1, -1, -1, -1} )}
)
)
);
//Report( ybuild )[FrameBox( 1 )] << journal;
);//));
New Window( "Yield Dashboard", MyHLB = H List Box() );
MyHLB << append(Report( ybuild )[FrameBox( 1 )]);
Jim