cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
mystylelife19
Level III

Add in row legend in Distribution with radio box

Hello community,

 

Before this I created a single radio box and biv plot but right now I have been improvising my script. Here is my problem so far

 

I have created my scripts that open 3 graphs, with self function radio box
1) Distribution
2) Fit Y by X
3) Radio Box
mystylelife19_0-1693817690084.png

 

My problem is:
1) Whenever I run the script, the row legend only appears IL_ALL and can't be changed even if I click on the radio box.
2) I want the radio box parameter to change the row legend on Distribution but I don't know how to create that script.
 
Please help me to rewrite my script. I am still a newbie on this JSL scripting.
//Get the current data Table
Names Default To Here( 1 );
dt = Current Data Table();

columnNames = dt << Get Column Names( "String" );

cl = New Window( "Column Selection", 
//	<<modal, // optional, probably not what you want
	H List Box(
		Panel Box( "Make a selection",
			allcolumn = Radio Box(
				columnNames,
				<<Set Function( Function( {self}, col = self << get selected ) )
			)
		)
	)
);

Distribution(
	Stack( 1 ),
	Arrange in Rows( 2 ),
	Continuous Distribution(
		Column(:IL_ALL_MAG_C1_S21),
		Horizontal Layout( 1 ),
		Vertical( 0 ),
		Normal Quantile Plot( 1 )
	),
	SendToReport(
		Dispatch(
			{"IL_ALL_MAG_C1_S21"},
			"",
			Border Box( 3 ),
			{Set Summary Behavior( "Collapse" )}
		),
		Dispatch(
			{"IL_ALL_MAG_C1_S21"},
			"Distrib Quantile Plot",
			FrameBox,
			{Row Legend(
				Eval (col),
				Color( 1 ),
				Color Theme( "Spectral"(1) ),
				Marker( 0 ),
				Marker Theme( "" ),
				Continuous Scale( 0 ),
				Reverse Scale( 0 ),
				Excluded Rows( 0 )
			)}
		),
		Dispatch( col, "", TextBox, {Rotate Text( "Left" )} )
	)
);

Bivariate( Y( :Y ), X( :X ), By( :WAFER_ID, :SITE_NO ) );
Here below I attach example data table:
1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Add in row legend in Distribution with radio box

You can use << Row Legend to add new legend to FrameBox. The most difficult part in this is to remove the old one, below is one suggestion using XPath (might not be robust enougH)

//Get the current data Table
Names Default To Here(1);
dt = Current Data Table();

columnNames = dt << Get Column Names("String");

cl = New Window("Column Selection",
	H List Box(
		dist = dt << Distribution(
			Continuous Distribution(Column(:IL_ALL_MAG_C1_S21), Normal Quantile Plot(1)),
			SendToReport(
				Dispatch({"IL_ALL_MAG_C1_S21"}, "", Picture Box(5), {Set Summary Behavior("Collapse")}),
				Dispatch(
					{"IL_ALL_MAG_C1_S21"},
					"Distrib Quantile Plot",
					FrameBox,
					{Row Legend(
						IL_ALL_MAG_C1_S21,
						Color(1),
						Color Theme("Spectral"),
						Marker(0),
						Marker Theme(""),
						Continuous Scale(0),
						Reverse Scale(0),
						Excluded Rows(0)
					)}
				)
			)
		),
		Panel Box("Make a selection",
			allcolumn = Radio Box(columnNames, <<Set Function(Function({self}, 
				cur_col = self << get selected;
				(Dist<< XPath("//BorderBox/OwnerBox/PictureBox/TableBox/../../..")) << Delete Box; // might not be robust enough
				fbox << Row Legend(
					Eval(cur_col),
					Color(1),
					Color Theme("Spectral"),
					Marker(0),
					Marker Theme(""),
					Continuous Scale(0),
					Reverse Scale(0),
					Excluded Rows(0)
				);
			)))
		)
	)
);

fbox = Report(dist)[FrameBox(1)];
-Jarmo

View solution in original post

3 REPLIES 3
mystylelife19
Level III

Re: Add in row legend in Distribution with radio box

//Get the current data Table
Names Default To Here( 1 );
dt = Current Data Table();

columnNames = dt << Get Column Names( "String" );

cl = New Window( "Column Selection",
	H List Box(
		Panel Box( "Make a selection",
			allcolumn = Radio Box(
				columnNames,
				<<Set Function( Function( {self}, col = self << get selected ) )
			)
		)
	)
);

Distribution(
	Continuous Distribution(
		Column( :IL_ALL_MAG_C1_S21 ),
		Normal Quantile Plot( 1 )
	),
	SendToReport(
		Dispatch(
			{"IL_ALL_MAG_C1_S21"},
			"",
			Picture Box( 5 ),
			{Set Summary Behavior( "Collapse" )}
		),
		Dispatch(
			{"IL_ALL_MAG_C1_S21"},
			"Distrib Quantile Plot",
			FrameBox,
			{Row Legend(
				IL_ALL_MAG_C1_S21,
				Color( 1 ),
				Color Theme( "Spectral" ),
				Marker( 0 ),
				Marker Theme( "" ),
				Continuous Scale( 0 ),
				Reverse Scale( 0 ),
				Excluded Rows( 0 )
			)}
		)
	)
);

Bivariate( Y( :Y ), X( :X ), By( :WAFER_ID, :SITE_NO ) );

Here the latest update script, sorry the previous one is the old one

jthi
Super User

Re: Add in row legend in Distribution with radio box

You can use << Row Legend to add new legend to FrameBox. The most difficult part in this is to remove the old one, below is one suggestion using XPath (might not be robust enougH)

//Get the current data Table
Names Default To Here(1);
dt = Current Data Table();

columnNames = dt << Get Column Names("String");

cl = New Window("Column Selection",
	H List Box(
		dist = dt << Distribution(
			Continuous Distribution(Column(:IL_ALL_MAG_C1_S21), Normal Quantile Plot(1)),
			SendToReport(
				Dispatch({"IL_ALL_MAG_C1_S21"}, "", Picture Box(5), {Set Summary Behavior("Collapse")}),
				Dispatch(
					{"IL_ALL_MAG_C1_S21"},
					"Distrib Quantile Plot",
					FrameBox,
					{Row Legend(
						IL_ALL_MAG_C1_S21,
						Color(1),
						Color Theme("Spectral"),
						Marker(0),
						Marker Theme(""),
						Continuous Scale(0),
						Reverse Scale(0),
						Excluded Rows(0)
					)}
				)
			)
		),
		Panel Box("Make a selection",
			allcolumn = Radio Box(columnNames, <<Set Function(Function({self}, 
				cur_col = self << get selected;
				(Dist<< XPath("//BorderBox/OwnerBox/PictureBox/TableBox/../../..")) << Delete Box; // might not be robust enough
				fbox << Row Legend(
					Eval(cur_col),
					Color(1),
					Color Theme("Spectral"),
					Marker(0),
					Marker Theme(""),
					Continuous Scale(0),
					Reverse Scale(0),
					Excluded Rows(0)
				);
			)))
		)
	)
);

fbox = Report(dist)[FrameBox(1)];
-Jarmo
mystylelife19
Level III

Re: Add in row legend in Distribution with radio box

This is work for me, even the loading might be lagging sometimes. But it's okay..

 

Anyway thankyou so much