cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
BrandonP1092
Level I

How do I add/make reference lines consistent within a control chart w/ Column Switcher?

I am attempting to re-create a control chart similar to the one below. I'm Levey-Jennings control charts with column switcher. The x-axis is consistent and it is an alphanumeric lot code. I currently need help adding the vertical blue reference lines for batch IDs. Ideally, these lines would remain as I move about through column switcher. 

 

I'm currently on JMP 15.2.0 on Windows 10

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions

Re: How do I add/make reference lines consistent within a control chart w/ Column Switcher?

The script you attached adds 5 reference lines.  They will be placed at x values of 1, 2, 3, 4, 5. If you want them placed in different locations, you will need to update the script with the appropriate locations.  


Please look at the Add Ref Line entry in the OSI to see how the syntax works for reference lines.

tonya_mauldin_0-1643901443616.png

 

View solution in original post

5 REPLIES 5

Re: How do I add/make reference lines consistent within a control chart w/ Column Switcher?

Here is an example of something similar that you can use.

dt=Open("$SAMPLE_DATA/Cities.jmp");
Control Chart Builder(
	Show Two Shewhart Charts( 0 ),
	Variables( Subgroup( :Region ), Y( :"pop- m"n ) ),
	Chart( Points( Statistic( "Average" ) ), Limits( Sigma( "Levey Jennings" ) ) ),
	Column Switcher( :"pop- m"n, {:"pop- m"n, :POP, :Max deg. F Jan, :OZONE, :CO} ),
	SendToReport(
		Dispatch(
			{},
			"Region",
			ScaleBox,
			{Add Ref Line( 1, "Solid", "Blue", "", 1 ),
			Add Ref Line( 2, "Solid", "Blue", "", 1 ),
			Add Ref Line( 3, "Solid", "Blue", "", 1 )}
		)
	)
)
BrandonP1092
Level I

Re: How do I add/make reference lines consistent within a control chart w/ Column Switcher?

Thank you, @tonya_mauldin. I was able to get the script to run without any bugs; however, it moved those reference points to the beginning of the control chart; rather than integrating them throughout. Any thoughts on this? 

 

Thanks again!

Re: How do I add/make reference lines consistent within a control chart w/ Column Switcher?

The script you attached adds 5 reference lines.  They will be placed at x values of 1, 2, 3, 4, 5. If you want them placed in different locations, you will need to update the script with the appropriate locations.  


Please look at the Add Ref Line entry in the OSI to see how the syntax works for reference lines.

tonya_mauldin_0-1643901443616.png

 

SDF1
Super User

Re: How do I add/make reference lines consistent within a control chart w/ Column Switcher?

Hi @BrandonP1092 ,

 

  In addition to what @tonya_mauldin has suggested, you might also consider adding either Spec Limits or Control Limits as meta data to your columns. Right click your column and select Column Info. From the Column Properties pulldown menu, select the one which is appropriate for your needs.

SDF1_0-1643896174387.png

After you enter the spec/control limits, you can select "Show as Graph Reference Lines", and each time you make a graph, distribution, etc with the data, it will have thin blue line(s) for the USL, LSL, and target (if not missing).

SDF1_1-1643896208737.png

If you are more advanced and do a lot of scripting, you can automate this process using the Analyze > Quality and Process > Manage Spec Limits platform. It makes your life a lot easier if you have to do this a lot.

SDF1_2-1643896307338.png

 

Hope this helps!,

DS

 

jthi
Super User

Re: How do I add/make reference lines consistent within a control chart w/ Column Switcher?

You could also use Graphic scripts. First calculate indices for the reference lines you have and then add graphic script with V Line:

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Quality Control/Coating.jmp");

ccb = dt << Control Chart Builder(
	Size(528, 456),
	Show Two Shewhart Charts(0),
	Show Control Panel(0),
	Show Limit Summaries(0),
	Variables(Subgroup(:Sample), Y(:Pin)),
	Chart(Points(Statistic("Average")), Limits(Sigma("Levey Jennings"))),
	Column Switcher(:Pin, {:Pin, :Weight, :Weight 2})
);

//calculate indices for references
uniq_vals = Associative Array(dt[0, "Sample"]) << get keys;
ref_vals = {4, 5, 6, 8};

/*jmp16
ref_idx = Transform Each({ref_val}, ref_vals,
	Contains(uniq_vals, ref_val) - 1
);
*/
//jmp15
ref_idx = [];
For(i = 1, i <= N Items(ref_vals), i++,
	idx = Contains(uniq_vals, ref_vals[i]);
	If(idx,
		Insert Into(ref_idx, idx - 1);
	)
);

//add reference lines as Graphic Script
rep = ccb << report;
framebox = rep[frame box(1)];
Eval(EvalExpr(framebox << Add Graphics Script(
	Pen Size(1);
	Pen Color("Blue");
	V Line(Expr(Transpose(ref_idx)));
)));

 

-Jarmo