Highlight certain points on control chartHi,
I want to highlight data points <= the limit values, 98% in this case, but something doesn't seem to work. I'm not sure where I'm making the error.

Here is my jsl code:
Names Default To Here( 1 );
dt2 = Current Data Table();<BR />
dt2 << begin data update;
fairows = dt2 << get rows where( As Column( "1" ) <= 0.98 );
dt2 << end data update;<BR />
vc1 = dt2 << Control Chart Builder(
Size( 890, 273 ),
Show Two Shewhart Charts( 0 ),
Test Excluded Subgroups( 0 ),
Include Missing Categories( 0 ),
Show Excluded Region( 0 ),
Show Limit Summaries( 0 ),
Variables( Subgroup( :Date ), Y( :"1"n ) ),
Chart(
Points( Statistic( "Individual" ) ),
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( "1" )} ),
Dispatch( {}, "Date", ScaleBox, {Label Row( {Label Orientation( "Angled" ), Set Font Size( 8 )} )} ),
Dispatch(
{},
"1",
ScaleBox,
{Add Ref Line( 0.928901607373389, "Dotted", "Medium Light Magenta", "Suggested (92.89%)", 3 ),
Add Ref Line( 0.897380548253792, "Solid", "Orange", "4.5 sigma(89.74%)", 2 ), Add Ref Line(
0.865859489134196, "Solid", "Medium Dark Green", "6 sigma(86.59%)", 2
), Add Ref Line( 0.9, "Dense Dash", "Medium Dark Red", "90.00%", 3 )}
),
Dispatch( {}, "graph display 1 title", TextEditBox, {Set Text( "" )} ),
Dispatch( {}, "Subgroup display 1 title", TextEditBox, {Set Text( "" ), Set Font Size( 10 ), Set Font Style( "Bold" )} ),
Dispatch( {}, "Y display 1 title", TextEditBox, {Set Text( "" )} ),
Dispatch( {}, "Control Chart Builder", FrameBox, {Background Color( -15658734 ), Marker Size( 2 ), Marker Drawing Mode( "Outlined" )} )
)
);
//Highlight data points < 98%
Eval(
Eval Expr(
Report( vc1 )[Framebox( 1 )] << add graphics script(
Marker(
Marker Size( 10 );
Color State( "red" );,
Expr( :"1"n[fairows] ),
Expr( :Date[fairows] )
)
)
)
);
Automation and ScriptingRe: Highlight certain points on control chartHere is one option which might do what you are looking for
Names Default To Here(1);
dt = Open("$DOWNLOADS/data.jmp");
fairows = dt << get rows where(As Column("1") <= 0.98);
vc1 = dt << Control Chart Builder(
Size(890, 273),
Show Two Shewhart Charts(0),
Test Excluded Subgroups(0),
Include Missing Categories(0),
Show Excluded Region(0),
Show Limit Summaries(0),
Variables(Subgroup(:Date), Y(:"1"n)),
Chart(Points(Statistic("Individual")), 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("1")}),
Dispatch({}, "Date", ScaleBox, {Label Row({Label Orientation("Angled"), Set Font Size(8)})}),
Dispatch({}, "1", ScaleBox,
{Add Ref Line(0.928901607373389, "Dotted", "Medium Light Magenta", "Suggested (92.89%)", 3),
Add Ref Line(0.897380548253792, "Solid", "Orange", "4.5 sigma(89.74%)", 2), Add Ref Line(
0.865859489134196, "Solid", "Medium Dark Green", "6 sigma(86.59%)", 2
), Add Ref Line(0.9, "Dense Dash", "Medium Dark Red", "90.00%", 3)}
),
Dispatch({}, "graph display 1 title", TextEditBox, {Set Text("")}),
Dispatch({}, "Subgroup display 1 title", TextEditBox, {Set Text(""), Set Font Size(10), Set Font Style("Bold")}),
Dispatch({}, "Y display 1 title", TextEditBox, {Set Text("")}),
Dispatch({}, "Control Chart Builder", FrameBox, {Background Color(-15658734), Marker Size(2), Marker Drawing Mode("Outlined")})
)
);
ms = Report(vc1)[FrameBox(1)] << Find Seg(MarkerSeg(1));
xs = ms << Get X Values;
ys = ms << Get Y Values;
Eval(Eval Expr(
Report(vc1)[Framebox(1)] << add graphics script(
Marker Size(10);
Marker(
Color State("red"),
Expr(xs[fairows]),
Expr(ys[fairows])
)
);
));Re: Highlight certain points on control chartThanks Jarmo!
Re: Highlight certain points on control chartOther good option would be to create new column your table and add row states based on that (you can also use it as row legend). This method does not allow you to modify marker size that easily though


Re: Highlight certain points on control chartHi @jthi ,
For some reason, it's highlighting values less than 0.007. However, the condition for getting rows is set to '>'. Something is not correct with xs and ys. Also, I don't want to color rows because it will reflect in another graph. Graphic script is the preference

Names Default To Here( 1 );
dt = Current Data Table();
fairows = dt << get rows where( As Column( "861" ) > 0.007 );
vc1 = dt << Control Chart Builder(
Size( 890, 273 ),
Show Two Shewhart Charts( 0 ),
Test Excluded Subgroups( 0 ),
Include Missing Categories( 0 ),
Show Excluded Region( 0 ),
Show Limit Summaries( 0 ),
Variables( Subgroup( :Date ), Y( :"861"n ) ),
Chart( Points( Statistic( "Average" ) ), 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( "861 Percent Fail: 1.45%" )}
),
Dispatch( {}, "Date", ScaleBox, {Label Row( {Label Orientation( "Angled" ), Set Font Size( 8 )} )} ),
Dispatch(
{},
"861",
ScaleBox,
{Add Ref Line( 0.00435435825878142, "Solid", "Blue", "3 sigma(0.44%)", 2 ), Add Ref Line(
0.00653153738817213, "Dotted", "Medium Light Magenta", "Suggested (0.65%)", 3
), Add Ref Line( 0.00870871651756283, "Solid", "Medium Dark Green", "6 sigma(0.87%)", 2 ), Add Ref Line(
0.007, "Dense Dash", "Medium Dark Red", "0.70%", 3
)}
),
Dispatch( {}, "graph display 1 title", TextEditBox, {Set Text( "" )} ),
Dispatch( {}, "Subgroup display 1 title", TextEditBox, {Set Text( "" ), Set Font Size( 10 ), Set Font Style( "Bold" )} ),
Dispatch( {}, "Y display 1 title", TextEditBox, {Set Text( "" )} )
)
);
ms = Report( vc1 )[FrameBox( 1 )] << Find Seg( Marker Seg( 1 ) );
xs = ms << Get X Values;
ys = ms << Get Y Values;
Eval(
Eval Expr(
Report( vc1 )[Framebox( 1 )] << add graphics script(
Marker Size( 10 );
Marker( Color State( "red" ), Expr( xs[fairows] ), Expr( ys[fairows] ) );
)
)
);
Re: Highlight certain points on control chartYou have to compare if they match the same rows. If not you might first want to re-order your data, get rows of interest, build control chart and then add the markers.
Re: Highlight certain points on control charthow can I compare?
Re: Highlight certain points on control chartTake values from your table and compare them to values of xs and ys (there are unlimited amount of ways of performing the comparison). It seems like your data also has single duplicate value which could potentially cause issues, maybe you should perform the comparison on the ys instead of the data table?
r = Loc(ys > 0.007);