Hi everyone
I am using graph builder to make the graphs in a report. I like to add the refence lines on the graph as CL,LCL,UCL. I have them in the columns (eg. X) in my table. I am trying to call them in the script like,
{Add Ref Line(:X, "Solid", "Black", "LCL", 1 )}
But it does not work
Could you please help me
Thanks
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)
});@jthi, Thank you.
I have the control limits as columns. I can call one cell as UCL[1], but the problem is, some of these columns have empty cells that might be the first or any other cell. I want to add the Ref line from the cell in the column which is not empty.
Do you have any idea how I can do that?
Thanks