Hi, I found this script previously in the community and save it becuse I need to create charts with different reference lines per group, hope this is also what you need.
NamesDefaultToHere(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
// Different values for each group takes more work
gb2 = dt << Graph Builder(
Size( 534, 488 ),
Show Control Panel( 0 ),
Show Legend( 0 ),
Variables( X( :weight ), Y( :height ), Group X( :sex ) ),
Elements( Points( X, Y, Legend( 8 ) ), Smoother( X, Y, Legend( 9 ) ) )
);
gb2Rep = Report(gb2);
// Females . . .
gb2Rep[Framebox(1)] << addGraphicsScript(
PenColor("Orange"); HLine(60);
Transparency(0.25);
FillColor("Green");
Rect(50, 60, 180, 55, 1);
FillColor("Blue");
Rect(50, 65, 180, 60, 1);
);
// Males . . .
gb2Rep[Framebox(2)] << addGraphicsScript(
PenColor("Orange"); HLine(65);
Transparency(0.25);
FillColor("Green");
Rect(50, 65, 180, 60, 1);
FillColor("Blue");
Rect(50, 70, 180, 65, 1);
);