cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Learn how to build custom Python data connectors and further customize JMP’s Data Connector Framework with the Python Data Connector Demo, available now in the JMP Marketplace!
  • See how to create experiments to support product design and ID useful product features. Register for June 12 webinar, 2pm US Eastern Time.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
Jackie_
Level VI

Append tablebox under each charts

How can I append a table box under each Control chart?

Trying to replicate like this...

Jackie__0-1767018199465.png

 

dt = Open( "$SAMPLE_DATA/Semiconductor Capability.jmp" );
tabtypes = {"Tab1", "Tab2", "Tab3"};
cols = {:NPN1, ::PNP1, PNP2, :NPN2, :PNP3, :IVP1};
obj = (dt << Tabulate(

	Add Table(
		Column Table( Statistics( Mean, Std Dev, Median Absolute Deviation, Quantiles( 90 ), Mode ) ),
		Row Table( Analysis Columns( :NPN1, :PNP1, :PNP2, :NPN2, :PNP3, :IVP1 ) )
	)
)) << Make Into Data Table;
new = New Window( "Maverick Trends", <<movewindow( 200, 150 ), H List Box( Panel Box( , H List Box( tabttx = Tab Box() ) ) ) );
For Each( {gettabs, idd}, tabtypes, 

	
	tabttx << Add(
		Tab Page Box(
			Title( gettabs ),
			V List Box(
				For Each( {parameters, idx}, cols, 
				

                                                                                
                                                                                                
					vc1 = dt << Control Chart Builder(
						Size( 1294, 431 ),
						Connect Thru Missing( 1 ),
						Show Two Shewhart Charts( 0 ),
						Test Excluded Subgroups( 0 ),
						Include Missing Categories( 0 ),
						Show Excluded Region( 0 ),
						Show Limit Summaries( 0 ),
						Variables( Subgroup( :SITE ), Y( As Column( parameters ) ) ),
						Chart(
							Points( Statistic( "Individual" ), Show Connect Line( 1 ) ),
							Limits( Sigma( "Moving Range" ), Show Center Line( 0 ), Show Lower Limit( 0 ), Show Upper Limit( 0 ) )
						),
						Show Control Panel( 0 ),
						SendToReport(

							Dispatch( {}, "Control Chart Builder", OutlineBox, {Set Title( parameters )} ),
							Dispatch( {}, "graph display 1 title", TextEditBox, {Set Text( "" )} ),
							Dispatch( {}, "Date", ScaleBox, {Label Row( Label Orientation( "Angled" ) )} ),
							Dispatch( {}, "Subgroup display 1 title", TextEditBox, {Set Font Size( 10 ), Set Font Style( "Bold" )} ),
							Dispatch( {}, "Y display 1 title", TextEditBox, {Set Text( "" )} )
						)
                                                                                                
                                                                                                                
					);
                                                                                                                
						
                                                                                
                                
                                                
                                                                                                
				
                                                                                                                                
                                                                                                                                
                                                                                                                                
				);
                                                                
			)
                                                                                                
		)
	);
                
                
                
	For( i = 1, i <= N Rows( obj ), i++, 
		
                                
                                
                                
                                                                                
                                                
		
                                                                
			v_te = Try( obj:Analysis Columns[i], "N/A" );
			v_mean = Try( Char( Format( obj:Mean[i], "Best", 12, 2 ) ), "N/A" );
			v_std = Try( Char( Format( obj:Std Dev[i], "Best", 12, 2 ) ), "N/A" );
			v_med = Try( Char( Format( obj:Mediani, "Best", 12, 2 ) ), "N/A" );
				vc1 << append(
			Panel Box( "Stats Summary: ",
				Table Box(
    
					String Col Box( "Metric", v_te ),
					String Col Box( "Mean", v_mean ),
					String Col Box( "Std Dev", v_std ),
					String Col Box( "Median", v_med ), 
					
                                                                                                                                
                                                                                                                
				)
			)
                                                                                                                                
			;
		);

		
	)
                
                
	;
);

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Append tablebox under each charts

View more...
Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");
tabtypes = {"Tab1", "Tab2", "Tab3"};

cols = {:NPN1, :PNP1, :PNP2, :NPN2, :PNP3, :IVP1};

obj = (dt << Tabulate(
	Add Table(
		Column Table(Statistics(Mean, Std Dev, Median Absolute Deviation, Quantiles(90), Mode)),
		Row Table(Analysis Columns(:NPN1, :PNP1, :PNP2, :NPN2, :PNP3, :IVP1))
	)
)) << Make Into Data Table;

new = New Window("Maverick Trends",
	<<movewindow(200, 150),
	H List Box(Panel Box("", H List Box(tabttx = Tab Box())))
);

For Each({gettabs, idd}, tabtypes, 
	tabttx << Add(
		Tab Page Box(
			Title(gettabs),
			vlb = V List Box()
		)
	);
	
	For Each({parameters, idx}, cols, 
		vlb << Append(vc1 = dt << Control Chart Builder(
			Size(1294, 431),
			Connect Thru Missing(1),
			Show Two Shewhart Charts(0),
			Test Excluded Subgroups(0),
			Include Missing Categories(0),
			Show Excluded Region(0),
			Show Limit Summaries(0),
			Variables(Subgroup(:SITE), Y(As Column(parameters))),
			Chart(
				Points(Statistic("Individual"), Show Connect Line(1)),
				Limits(
					Sigma("Moving Range"),
					Show Center Line(0),
					Show Lower Limit(0),
					Show Upper Limit(0)
				)
			),
			Show Control Panel(0),
			SendToReport(Dispatch({}, "Control Chart Builder", OutlineBox, {Set Title(parameters)}),
				Dispatch({}, "graph display 1 title", TextEditBox, {Set Text("")}),
				Dispatch({}, "Date", ScaleBox, {Label Row(Label Orientation("Angled"))}),
				Dispatch({}, "Subgroup display 1 title", TextEditBox, {Set Font Size(10), Set Font Style("Bold")}),
				Dispatch({}, "Y display 1 title", TextEditBox, {Set Text("")})
			)
		);
		curcol = parameters << get name;
		r = obj << Get Rows Where(:Analysis Columns == curcol);
		
		If(N Items(r) > 0,
			vlb << append(
				Panel Box("Stats Summary: ",
					Table Box(
						String Col Box("Metric", obj[r, "Analysis Columns"]),
						Number Col Box("Mean", obj[r, "Mean"]),
						Number Col Box("Std Dev", obj[r, "Std Dev"]),
						Number Col Box("Median", obj[r, "Median"])
					)
				)
			);			
		);
	));
);
-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User

Re: Append tablebox under each charts

View more...
Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");
tabtypes = {"Tab1", "Tab2", "Tab3"};

cols = {:NPN1, :PNP1, :PNP2, :NPN2, :PNP3, :IVP1};

obj = (dt << Tabulate(
	Add Table(
		Column Table(Statistics(Mean, Std Dev, Median Absolute Deviation, Quantiles(90), Mode)),
		Row Table(Analysis Columns(:NPN1, :PNP1, :PNP2, :NPN2, :PNP3, :IVP1))
	)
)) << Make Into Data Table;

new = New Window("Maverick Trends",
	<<movewindow(200, 150),
	H List Box(Panel Box("", H List Box(tabttx = Tab Box())))
);

For Each({gettabs, idd}, tabtypes, 
	tabttx << Add(
		Tab Page Box(
			Title(gettabs),
			vlb = V List Box()
		)
	);
	
	For Each({parameters, idx}, cols, 
		vlb << Append(vc1 = dt << Control Chart Builder(
			Size(1294, 431),
			Connect Thru Missing(1),
			Show Two Shewhart Charts(0),
			Test Excluded Subgroups(0),
			Include Missing Categories(0),
			Show Excluded Region(0),
			Show Limit Summaries(0),
			Variables(Subgroup(:SITE), Y(As Column(parameters))),
			Chart(
				Points(Statistic("Individual"), Show Connect Line(1)),
				Limits(
					Sigma("Moving Range"),
					Show Center Line(0),
					Show Lower Limit(0),
					Show Upper Limit(0)
				)
			),
			Show Control Panel(0),
			SendToReport(Dispatch({}, "Control Chart Builder", OutlineBox, {Set Title(parameters)}),
				Dispatch({}, "graph display 1 title", TextEditBox, {Set Text("")}),
				Dispatch({}, "Date", ScaleBox, {Label Row(Label Orientation("Angled"))}),
				Dispatch({}, "Subgroup display 1 title", TextEditBox, {Set Font Size(10), Set Font Style("Bold")}),
				Dispatch({}, "Y display 1 title", TextEditBox, {Set Text("")})
			)
		);
		curcol = parameters << get name;
		r = obj << Get Rows Where(:Analysis Columns == curcol);
		
		If(N Items(r) > 0,
			vlb << append(
				Panel Box("Stats Summary: ",
					Table Box(
						String Col Box("Metric", obj[r, "Analysis Columns"]),
						Number Col Box("Mean", obj[r, "Mean"]),
						Number Col Box("Std Dev", obj[r, "Std Dev"]),
						Number Col Box("Median", obj[r, "Median"])
					)
				)
			);			
		);
	));
);
-Jarmo
Jackie_
Level VI

Re: Append tablebox under each charts

Thanks Jarmo! This is being added above the chart, not below it.


It's working.. Thanks

Recommended Articles