cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
JMewborn
Level II

Add Reference Lines to multiple Variability Charts in a Column Group

I have many columns with spec limits saved to column properties. I am trying to add reference lines to multiple variability charts in a column group. My problem is I cant seem to add these lines without looping through and creating over 400 instances of a variability chart and adding them manually. This causes way to much memory to be used and slows down if not crashes JMP. The first reference line I am looking to add can be followed by this code. Here index i refers to the particular column in the column group that I am looping through:

 

report(gb)[axis box( 1 )] << Add Ref Line(
{Num(
Substr(
Char( As List( Column( As List( DT << Get column Group( "Processes" ) )[i] ) << Get Property( "Spec Limits" ) )[1] ),
5,
Length( Char( As List( Column( As List( DT << Get column Group( "Processes" ) )[i] ) << Get Property( "Spec Limits" ) )[1] ) ) - 5
)
), Num(
Substr(
Char( As List( Column( As List( DT << Get column Group( "Processes" ) )[i] ) << Get Property( "Spec Limits" ) )[2] ),
5,
Length( Char( As List( Column( As List( DT << Get column Group( "Processes" ) )[i] ) << Get Property( "Spec Limits" ) )[2] ) ) - 5
)
)},
"Solid",
"Light Green",
"",
1,
0.25
);

 

Below is how I would like to implement this code, so that I dont create a new instance of a variability chart for each spec. I just do not know how to add custom reference lines to the below code. Basically I want to initially add a reference line range that highlights between LSL and USL in light green for each spec. 

 

open("$SAMPLE_DATA/Semiconductor Capability.jmp");
DT = Current Data Table();
DT << Manage Limits(
Process Variables(
DT << Get Column Group ("Processes")
), 
<< Show Limits All,
<< Save to Column Properties,
close window
);

SpecVarCharts = Variability Chart( Y( Column Group( "Processes" ) ), X( :Wafer, :Site ),Connect Cell Means( 1 ), Std Dev Chart(0));

 

 

Any help would be greatly appreciated. 

Josh
1 REPLY 1
jthi
Super User

Re: Add Reference Lines to multiple Variability Charts in a Column Group

Get references to the outline boxes in variability chart and loop over those while setting reference lines

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp"); // column properties are already set

varchart = dt << Variability Chart(
	Y(Column Group("Processes")),
	X(:Wafer, :Site),
	Connect Cell Means(1),
	Std Dev Chart(0),
	invisible
);

obs = varchart << XPath("//OutlineBox[contains(text(), 'Variability Chart for')]");
For Each({ob}, obs,
	colname = Substitute(ob << get title, "Variability Chart for ", "");
	specs = Column(dt, colname) << Get Property("Spec Limits");
	low = specs["LSL"] - 5;
	high = specs["USL"] + 5;
	
	ob[AxisBox(1)] << Add Ref Line(low, "Solid", "Light Green", "", 1, 0.25);
	ob[AxisBox(1)] << Add Ref Line(high, "Solid", "Light Green", "", 1, 0.25);
);

varchart << Show Window(1);
-Jarmo