Names Default To Here( 1 ); setup = Function({}, {Default Local}, dt = Open( "$SAMPLE_DATA/CrimeData.jmp" ); dt << Select Where( :Region == "South" ); cfg1 = EvalList({dt << Data View, {"Population", "Violent Rate"}}); dt << Select Where( :Region == "Pacific" ); cfg2 = EvalList({dt << Data View, {"Population", "Property Rate"}}); dt << Select Where( :Region == "Mountain" ); cfg3 = EvalList({dt << Data View, {"Population", "Murder Rate"}}); EvalList({cfg1, cfg2, cfg3}); // return value ); build_graphs = Function({cfgs}, {Default Local}, win = New Window( "Example", vlb = V List Box( ) ); ncfg = NItems(cfgs); for(i = 1, i <= ncfg, i++, {this_dt, this_cols} = cfgs[i]; ncols = NItems(this_cols); for(j = 1, j <= ncols, j++, vlb << Append(this_dt << Graph Builder( Show Control Panel( 0 ), Variables( X( :Year ), Y( Column(this_dt, this_cols[j]) ), Overlay( :State ) ), Elements( Points( X, Y ), Smoother( X, Y ) ) )); ) ); ); // Main cfgs = setup(); Show(cfgs); win = build_graphs(cfgs); win << Save Window Report( "automated_gb2.jrp", embed data( 1 ) );