I've done this sort of thing, still looking for something better though:
Names default to here( 1 );
dt = Open( "$Sample_data/Big Class.jmp" );
//Window to hold graphs
win = New window("Graphs",
lub = Lineup Box( NCol( 3 ) )
);
//List of graphs to make
ages = ( Associative Array( Column( dt, "age" ) ) << Get Keys );
//For each graph
For( i = 1, i <= N Items( ages ), i++,
//Add graph to the lineup box
lub << Append( Graph Builder(
Size( 300, 300 ),
Show Control Panel( 0 ),
Show Footer( 0 ),
Variables( X( :height ), Y( :weight ) ),
Elements( Points( X, Y, Legend( 3 ) ) ),
Local Data Filter(
Close Outline( 1 ),
Add Filter(
columns( :age ),
Where( :age == ages[i] ),
Display( :age, Size( 224, 126 ), List Display )
)
),
SendToReport(
Dispatch( {}, "Graph Builder", OutlineBox, {Set Title( "Age: " || char(ages[i]) )} ),
Dispatch( {}, "graph title", TextEditBox, {Set Text( "" )} )
)
); );
);
//Hide all of the data filters
(win << XPath("//OutlineBox[@helpKey='Data Filter']") ) << Visibility("collapse");