Here is a sample script that adds a chart every time the column switcher is changed.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Process Measurements.jmp" );
new window("The Journal", <<journal);
gb = Control Chart Builder(
Size( 528, 458 ),
Show Control Panel( 0 ),
Show Limit Summaries( 0 ),
Variables( Y( :Process 1 ) ),
Chart( Position( 1 ) ),
SendToReport(
Dispatch(
{"Process 1 Limit Summaries", "Process Capability Analysis", "Histogram"
},
"Process Capability Analysis Histogram",
FrameBox,
{Frame Size( 320, 20 )}
)
)
);
columnSwitcher = gb <<
Column Switcher(
:Process 1,
{:Process 1, :Process 2, :Process 3, :Process 4,
:Process 5, :Process 6, :Process 7}
);
pre = Function( {currentColumn, nextColumn, switcher},
dummy=1;
);
post = Function(
{previousColumn, currentColumn, switcher},
current report()["Control Chart Builder"]<<journal;
);
columnSwitcher <<
Make Column Switch Handler( pre,post );
// The below line was added to ensure the first chart is automatically
// moved to the journal
current report()["Control Chart Builder"]<<journal;
Jim