The thing to keep in mind about the VariabilityPlot is that each least-significant-group has a width of exactly 1 on the hidden x-axis, starting at zero. This makes it pretty simple to add the relevant lines.
The only slight complication is figuring out how many sub-groups each of the larger groups contains, but the Summary function of the data table can aid there.
Here is an example script that does what you ask:
names default to here(1);
dt =
// Open Data Table: Big Class.jmp
// → Data Table( "Big Class" )
Open( "$SAMPLE_DATA/Cars.jmp" );
rpt = dt << Variability Chart(
Y( :Head IC),
X( :Make, :Model ),
Analysis Type( "Choose best analysis (EMS REML Bayesian)" ),
Show Range Bars( 0 ),
Show Cell Means( 0 ),
Std Dev Chart( 0 ),
Points Jittered( 1 ),
Where( :NAME("D/P") == "Driver" & :Protection == "manual belts" ),
);
//find groupings:
rows = dt << Get Rows Where( :NAME("D/P") == "Driver" & :Protection == "manual belts" );
subt = dt << Subset( Rows( rows ), Columns( :Make, :Model, :Wt ), Not Linked, Private );
sumt = subt << Summary( Group( :Make, Model ), Mean( :Wt ), Statistics Column Name Format( "Column" ), Link to Original Data Table( 0 ), Private );
Close( subt, No Save );
subt = sumt << Summary( Group( :Make ), Mean( :Wt ), Statistics Column Name Format( "Column" ), Link to Original Data Table( 0 ), Private );
Close( sumt, No Save );
category number = [=>];
category average = [=>];
For Each Row( subt,
category number[:Make] = :N Rows; // each least-significant category in a VariabilityPlot is exactly X=1 width on the hidden x-axis, starting at zero
category average[:Make] = :Wt
);
Close( subt, No Save );
tree = rpt << Report;
Eval( Eval Expr(
tree[FrameBox( 1 )] << Add Graphics Script(
Local( {values = Expr( category average ), numbers = Expr( category number ), i, items, sum = 0},
items = numbers << Get Keys;
Pen Size( 2 );
Pen Color( "Blue" );
Summation( i = 1, N Items( items ),
Line( Eval List( {sum, values[items[i]]} ), Eval List( {sum += numbers[items[i]], values[items[i]]} ) );
0
)
)
)
) )
Jordan