Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
bar_zer
Level I

How to add ref lines to chart based on Chart type filter (X-BAR, UNIF, MAX..)

I am trying to add ref lines to chart and I want them to change whenever I filter to other chart types in the report (the limits are deferents). I couldn't find out how to do it.

I tried this:

 

Dispatch(
{},
"2",
ScaleBox,
{
dt_final << get selected rows;
check = dt_final << Get Rows Where(:CHART_TYPE == "UNIF-3" );
If( N Rows( check ) > 0,
nc2u1[Axis Box(1)] << Add Ref Line( 5, "Solid", "Medium Dark Red", "LL", 10));}

 

And this:

 

{if (:CHART_TYPE[1] == "X-BAR",
Add Ref Line( 100, "Solid", "red", "UCL", 1 ),
Add Ref Line( 150, "Solid", "red", "CENTERLINE", 1 ),
Add Ref Line( 200, "Solid", "red", "LCL", 1 ));
}
2 REPLIES 2
Highlighted
txnelson
Super User

Re: How to add ref lines to chart based on Chart type filter (X-BAR, UNIF, MAX..)

Take a look at the Column Property, "Control Limits".  It allows you to have multiple copies of Control Limits, for each of the different chart types, and will display the appropriate limits with the appropriate charts.

Jim
Highlighted
Byron_JMP
Staff

Re: How to add ref lines to chart based on Chart type filter (X-BAR, UNIF, MAX..)

@txnelson is right on. Its way-way easier to use the built in column property that trying to script this.

JMP Systems Engineer, Pharm and BioPharm Sciences