Subscribe Bookmark RSS Feed

How to Hide Outline Box of Graph Builder

agonzales2021

Contributor

Joined:

Jun 23, 2017

I would like to Hide the outline box that surrounds a graph builder.

 

I tried making it a report and deleting the Outline Box like 
ybuild = Graph Builder();
yrep = ybuild << report;
yrep[ OutlineBox(1) ] << Delete;
The entire report just disappears.

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson

Super User

Joined:

Jun 22, 2012

Solution

The graphic from the Graph Builder is nested underneath the outline box, therefore, if you delete the outline box, it will delete the graph.  Therefore, you need to move the graphic.  Below is a simple example of how to do that

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\big class.jmp" );
gb = Graph Builder(
	Size( 519, 448 ),
	Show Control Panel( 0 ),
	Variables( X( :age ), Y( :sex ) ),
	Elements( Points( X, Y, Legend( 5 ) ) )
);
Report( gb )[FrameBox( 1 )] << journal;
Jim
9 REPLIES
agonzales2021

Contributor

Joined:

Jun 23, 2017

 
txnelson

Super User

Joined:

Jun 22, 2012

Solution

The graphic from the Graph Builder is nested underneath the outline box, therefore, if you delete the outline box, it will delete the graph.  Therefore, you need to move the graphic.  Below is a simple example of how to do that

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\big class.jmp" );
gb = Graph Builder(
	Size( 519, 448 ),
	Show Control Panel( 0 ),
	Variables( X( :age ), Y( :sex ) ),
	Elements( Points( X, Y, Legend( 5 ) ) )
);
Report( gb )[FrameBox( 1 )] << journal;
Jim
agonzales2021

Contributor

Joined:

Jun 23, 2017

Hi Jim, thanks for your timely reply.. I'm trying it and I'm not seeing any kind of change.

 

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",
Lineup Box(NCol(2), Y_Graph );
);

markbailey

Staff

Joined:

Jun 23, 2011

This script includes a lot of details that get in the way of testing a solution. I suggest you test your scheme to remove the outline box to work first with a simple example, then apply it to the real chart.

Learn it once, use it forever!
txnelson

Super User

Joined:

Jun 22, 2012

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
markbailey

Staff

Joined:

Jun 23, 2011

Just a brief follow up to Jim's reply...

It isn't obvious when you look at a JMP window that the objects making up the window are nested. This branching structure leads to the name display tree. You can see the structure by right-clicking on the gray triangle to the left of the outline box and select Edit > Show Display Tree. You can delete any display box but it also removes any display boxes within.

Besides journaling, you can clone a display box (and its contents) and then include them in another window. Note that the cloning generally loses the interactivity of the original object, like journaling, but this way is another alternative to consider for your purpose.

Learn it once, use it forever!
XanGregg

Staff

Joined:

Jun 23, 2011

Setting the outline title to empty will make it hide the top part.

 

ybuild = Graph Builder( ... );
yrep = ybuild << report;
yrep[ OutlineBox(1) ] << Set Title("");
txnelson

Super User

Joined:

Jun 22, 2012

Wow....another thing I knew at one time that I lost somewhere along the way.  

Great post.....

Jim
pmroz

Super User

Joined:

Jun 23, 2011

Similar to Xan's solution, in the graph-builder JSL you could do this:

dt = open("$sample_data\Big Class.jmp");

Graph Builder(
	Size( 526, 451 ),
	Show Control Panel( 0 ),
	Variables( X( :weight ), Y( :height ) ),
	Elements( Points( X, Y, Legend( 16 ) ), Line( X, Y, Legend( 18 ) ) ),
	SendToReport(
		Dispatch( {}, "Graph Builder",
			OutlineBox, {Set Title( "" )}
		)
	)
);