Depending on your data you could do it this way:
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
//add limit columns
dt << New Column("UCL", Numeric, Continuous, Set Each Value(70));
dt << New Column("CL", Numeric, Continuous, Set Each Value(60));
dt << New Column("LCL", Numeric, Continuous, Set Each Value(50));
gb = Graph Builder(Variables(X(:age), Y(:height)), Elements(Points(X, Y, Legend(4))));
axisb = (report(gb)[axisbox(2)]);
axisb << ({
Add Ref Line(dt:UCL[1], "Solid", "Black", "UCL", 1),
Add Ref Line(dt:CL[1], "Solid", "Black", "CL", 1),
Add Ref Line(dt:LCL[1], "Solid", "Black", "LCL", 1)
});
Or plot those columns directly:
or set those to column properties as spec limits:
All these can be scripted if needed.
Edit:
And if you meant you have Control Limit Column property set, it will require a bit extra scripting to get the limits out of column property (parse part will most depend a bit on case and how control limits are set, but the idea should be same):
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Quality Control/Coating.jmp");
obj = dt << Control Chart(Sample Size(:Sample), KSigma(3), Chart Col(:Weight, XBar, R));
Wait(0);
obj << Save Limits(in Column);
gb = Graph Builder(
Variables(X(:Sample), Y(:Weight)),
Elements(Points(X, Y, Legend(3)), Smoother(X, Y, Legend(4)))
);
//get Control Limits column property and parse limits
colProp = dt:weight << Get Property("Control Limits");
xbarLimits = Words(Char(colProp[1]));
xbarCL = Num(Word(3, xbarLimits[1], "()"));
xbarLCL = Num(Word(2, xbarLimits[2], "()"));
xbarUCL = Num(Word(2, xbarLimits[3], "()"));
//add control limits
axisb = (report(gb)[axisbox(2)]);
axisb << ({
Add Ref Line(xbarUCL, "Solid", "Black", "UCL", 1),
Add Ref Line(xbarCL, "Solid", "Black", "CL", 1),
Add Ref Line(xbarLCL, "Solid", "Black", "LCL", 1)
});
-Jarmo