cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Registration open for Discovery Summit Europe. User Group Members benefit from a 25% discount with the code: DSEUgroup24
Choose Language Hide Translation Bar
jthi
Super User

Show Legend on each graph on builder when using Page

This was asked today at least in chat. Below are couple of possible options on how to handle this (I also posted this to wishlist as suggestionAdd option to extend Graph Builders legend to each page when Page is being used )

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Probe.jmp");

// Use XPatH() and Picture Box with legend
gb = dt << Graph Builder(
	Show Control Panel(0),
	Size(500, 9760),
	Variables(X(:DELW_NEMIT), Y(:DELL_RPNBR), Page(:Wafer Number), Color(:Process)),
	Elements(Points(X, Y, Legend(5)))
);

lg = (gb << XPath("//LegendBox"))[1];
lg_pic = lg << get picture;

fbs = (gb << XPath("//FrameBox")) << parent;
Remove From(fbs, 1); // first one already has "real" legend
//margins will need to be adjusted depending on GB size
fbs << append(Picture Box(lg_pic, << Margin(Left((gb << get size)[1]-130), Top(-15), Right(0), Bottom(0))));


// Loop over groups one by one while using Where()
nw = New Window("GBs",
	lub = Lineup Box(N Col(1));
);
Summarize(dt, pages = by(:Wafer Number));

For Each({page}, pages,
	gb_page_expr = Expr(
		Eval(EvalExpr(gb = dt << Graph Builder(
			Show Control Panel(0),
			Size(500, 500),
			Variables(X(:DELW_NEMIT), Y(:DELL_RPNBR), Color(:Process), Group X(:Wafer Number)),
			Elements(Points(X, Y, Legend(5))),
			Where(:Wafer Number == Expr(page))
		)));
	);
	lub << Append(gb_page_expr);
	// gb << Title("");
);
((lub << Top Parent) << XPath("//TextBox[contains(text(), 'Where(:')]")) << Visibility("Collapse");


// most likely best idea, use By()
gbs = Graph Builder(
	Size(534, 456),
	Show Control Panel(0),
	Variables(X(:DELW_NEMIT), Y(:DELL_RPNBR), Color(:Process)),
	Elements(Points(X, Y, Legend(1))),
	By(:Wafer Number)
);

Write();
-Jarmo
1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Show Legend on each graph on builder when using Page

@glimond67 there are two options:

use Dialog button (julian demonstrates it here Re: Repeat legend with every page )

jthi_2-1663789817887.png

 

or

 

go to red triangle -> Redo / Relaunch Analysis

jthi_0-1663789641847.png

This will open platform menu you can fill (and if you had something already filled those will be kept)

jthi_1-1663789674307.png

 

-Jarmo

View solution in original post

3 REPLIES 3
glimond67
Level I

Re: Show Legend on each graph on builder when using Page

@martindemel

 

--> // most likely best idea, use By()

 

This works.

But how to guess there is BY function on Graph Builder, where can it be found in the Graph Builder's Control Panel?

 

My regular use case mostly has a wrap included, like this.

gbs = Graph Builder(
	Size(534, 456),
	Show Control Panel(0),
	Variables(X(:DELW_NEMIT), Y(:DELL_RPNBR), Wrap( :Die X ), Color(:Process)),
	Elements(Points(X, Y, Legend(1))),
	By(:Wafer Number)
);

and the scripted BY() still works.

But I don't see how I can produce this from Graph Builder interface alone.

 

 

jthi
Super User

Re: Show Legend on each graph on builder when using Page

@glimond67 there are two options:

use Dialog button (julian demonstrates it here Re: Repeat legend with every page )

jthi_2-1663789817887.png

 

or

 

go to red triangle -> Redo / Relaunch Analysis

jthi_0-1663789641847.png

This will open platform menu you can fill (and if you had something already filled those will be kept)

jthi_1-1663789674307.png

 

-Jarmo
WebDesignesCrow
Super User

Re: Show Legend on each graph on builder when using Page

Thanks a lot @jthi ! It solved my problem