Hi,
How can I draw spec limits(red line) by data category in variability chart as below example? The red line was done by manual in pptx.
Attach jmp file data for reference. Appreciate for your reply. Thanks.
Names Default To Here(1); dt1 = Open("$DOWNLOADS/sample data.jmp"); dt = dt1 << Stack( // stack to get proper data format columns(:A10, :A20, :A30), Source Label Column("SampleGroup"), Output Table("Stack") ); // Add limits as they were not provided dt << New Column("LSL", Numeric, Continuous, Values([10, 10, 10, 10, 10, 10, 10, 10, 10, 20, 20, 20, 20, 20, 20, 20, 20, 20])); dt << New Column("Target", Numeric, Continuous, Values([20, 20, 20, 20, 20, 20, 20, 20, 20, 40, 40, 40, 40, 40, 40, 40, 40, 40])); dt << New Column("USL", Numeric, Continuous, Values([30, 30, 30, 30, 30, 30, 30, 30, 30, 50, 50, 50, 50, 50, 50, 50, 50, 50])); var = dt << Variability Chart(Y(:Data), X(:Phase, :SampleGroup)); dt_summary = dt << Summary( Group(:Phase), Max(:LSL), Mean(:Target), Min(:USL), N Categories(:SampleGroup), Freq("None"), Weight("None"), statistics column name format("column"), Link to original data table(0) ); dt_summary << Delete Columns("N Rows"); // We need access to the framebox fb = Report(var)[Outline Box("Variability Chart for Data"), Frame Box(1)]; //Get phases count (this was missing) Summarize(dt, phases = By(:Phase)); // Using graphic scripts most likely easiest option xidx = 0; For(i = 1, i <= N Items(phases), i++, curphase = dt_summary[i, "Phase"]; curlsl = dt_summary[i, "LSL"]; curusl = dt_summary[i, "USL"]; curtarget = dt_summary[i, "Target"]; curcount = dt_summary[i, "SampleGroup"]; xend = xidx + curcount; lslstart = Eval List({xidx, curlsl}); lslend = Eval List({xend, curlsl}); uslstart = Eval List({xidx, curusl}); uslend = Eval List({xend, curusl}); targetstart = Eval List({xidx, curtarget}); targetend = Eval List({xend, curtarget}); xidx = xend; Eval(EvalExpr( fb << Add Graphics Script( Pen Color("Red"); Pen Size(1); Line(Expr(lslstart), Expr(lslend)); // {x1, y1}, {x2, y2} Line(Expr(uslstart), Expr(uslend)); // {x1, y1}, {x2, y2} Pen Color("Blue"); Line(Expr(targetstart), Expr(targetend)); // {x1, y1}, {x2, y2} ); )); ); fb << Y Axis(Max(1.1*Max(Col Max(Column(dt, "Data")), Col Max(Column(dt_summary, "USL"))))); // adjust yaxis
You have to calculate the group counts in different manner. One quite simple option could be to add new column to your dt which combines leg and layer
dt << new column("LEGLAYER", Character, Nominal, Formula(:Leg ||:Layer));
then use that in the summary
dt_summary = dt << Summary( Group(:SampleGroup), Max(:LSL), //Mean(:Target), Min(:USL), N Categories(:LEGLAYER), Freq("None"), Weight("None"), statistics column name format("column"), Link to original data table(0) );
and get the curcount from that
curcount = Sum(dt_summary[i, {"LEGLAYER"}]);
Does Varying spec limits by data category in variability chart give some ideas?
Hi jthi,
I checked and followed steps, but it still didn't work, even directly used its attachment file and script.
Using your data (+ adding limits) and making small fix to the script from that thread
You did indeed draw the chart I wanted, but I still don't know how to modify the script. Anyway, thanks for your reply
Hi there,If you're looking for a scripting-free solution and okay with using Graph Builder, it actually handles multi-level spec limits by category — just make sure your spec limits are structured accordingly (e.g., via column property).
If you specifically want to stay with Variability Chart, this behavior isn’t built-in in core JMP — but it is supported in YieldOptiX, a plugin developed for test data analysis. It adds support for category-based spec limits directly in the Variability Chart.
So both options (Graph Builder or Variability Chart with grouped limits) are supported depending on your preferred interface — just depends on what fits your process best.