setting spec limit to column property by JSL - lines not shown on plotHi
I have a script that assigns spec limits (USL/LSL) to columns property, and then make a plot of the column, and I expect
to see the limits lines drawn on the plot. What happens is that the limits are set correctly in the table, but not visible on the plot.
If I draw the same plot to this column manually after running the script - no lines again.
If I open the column spec property window, I see the limits, the 'show reference line' is on.
only if I hit 'Apply' and then plot again - I can see the lines on the plot as expected. But I can't get it to work by script..
any idea?
(using JMP PRO 15)


Data TableGraphicsScriptingWindowsRe: setting spec limit to column property by JSL - lines not shown on plotHi @shlomi_bakish ,
Can you provide an example of your JSL code? This might help to diagnose the issue you are having. In the meantime, this portion of code is an example of how you can set the spec limits for the columns and ensure that they are turned on for graphing.
//Turn on spec lines for graphs
dt = Current Data Table( ); //just a way of setting the current data table to the variable dt
<BR />dt_ColNames = dt << Get Column Names( string ); //Gets the column names from the data table
<BR />For( i = 1, i <= N Items( dt_ColNames ), i++,<BR />
spec = Column( dt, dt_ColNames[i] ) << Get Property( "Spec Limits" ); //This gets the Boolean spec property of each column
<BR />//now, for each column perform the task of assigning the spec limits<BR /> If( Is Empty( spec ) == 0,
LSL = Try( spec["LSL"], . );
USL = Try( spec["USL"], . );
Target = Try( spec["Target"], . );
Eval(
Substitute(
Expr(
Column( dt, dt_ColNames[i] ) << Set Property(
"Spec Limits",
{LSL( __LSL__ ), USL( __USL__ ), Target( __Target__ ), Show Limits( 1 )}
),
),
Expr( __LSL__ ), LSL,
Expr( __USL__ ), USL,
Expr( __Target__ ), Target
)
);//This whole Eval() is wrapping a Substitution(), which wraps an expression Expr(). <BR /> //The variables that will be substituted are __LSL__ and so on. The Show Limits (1) checks the box to turn on the limits as reference lines.
);
); This should help get you going in the right direction. But, without seeing your code and understanding what you're doing, it's hard to be more specific to address your exact need.
Hope this helps!,
DS
Re: setting spec limit to column property by JSL - lines not shown on plotthanks for the prompt reply ! I assumed the code is not really relevant, since it does get the spec limits set correctly in the column properties.
it sets LSL and USL and show Limits (1), but the plot doesn't show them even though they are set correctly.
Even if I use a straight forward code with fixed numbers, it behaves the same..
Column(DATA_DT,param) << Set Property( "Spec Limits", LSL( 0.31 ),USL(0.34),Show Limits(1) );

Only after hitting 'apply' and drawing the graph again - it shows the lines.
Re: setting spec limit to column property by JSL - lines not shown on plotSyntax seems to be slightly off, you have to add {} after Spec Limits. See below script, weight wont work without pressing apply and height will.
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
Column(dt, "weight") << Set Property("Spec Limits", LSL(50), USL(150), Show Limits(1));
Column(dt, "height") << Set Property("Spec Limits", {LSL(50), USL(100), Show Limits(1)});
gb = dt << Graph Builder(
Size(534, 456),
Show Control Panel(0),
Variables(X(:weight), Y(:height)),
Elements(Points(X, Y, Legend(4)), Smoother(X, Y, Legend(5)))
);Re: setting spec limit to column property by JSL - lines not shown on plotIt appears that you are applying the limits after the chart is initially displayed. The limits are drawn when the chart is initially displayed, and if limits are added after that point, the chart will have to be redrawn to get them to display.
Re: setting spec limit to column property by JSL - lines not shown on plotThanks ! indeed adding the curly braces solved the problem 
Can you explain why is