I copied Bryon's control chart code into yours, added a random 'min' time, and here is what I see:
//Open a window to show a control chart and then update
//the chart every 15 seconds
//Includes a button to refresh early.
Names Default To Here( 1 );
//Define variables here that need to keep their values through subsequent function calls
//This includes the window and data table
//Open a window to hold the chart (note this only happens once)
nw = New Window( "Control Chart",
V List Box(
Button Box( "New Data", UpdateData() ),
holder = H List Box();
)
);
//Make a variable to hold a reference to the data table
dt = .;
//A function that will update the chart
UpdateData = Function( {},
//Close the table if it is already open
Try( dt << Close Window );
//Open data table
dt = Open( "$SAMPLE_DATA/Abrasion.jmp", Private );
//Make the control chart
obj = dt << Control Chart(
Group Size( 1 ),
KSigma( 3 ),
Chart Col( :Abrasion, Individual Measurement ),
SendToReport(
Dispatch(
{"Individual Measurement of Abrasion"},
"1",
ScaleBox,
{Min( nrows() - Floor( Random Uniform( 10, 25 ) ) ), Max( nrows() + 2 ), Inc( 5 ),
Minor Ticks( 1 )}
)
)
);
//Hide the temporary control chart window
obj << ShowWindow( 0 );
//Remove existing/old graph from the window (if there is one)
Try( (holder << Child) << Delete );
//Add the new graph
holder << Append( (H List Box( (obj << Report) << Clone Box )) );
//Close the temporary control chart
obj << Close Window;
);
//Script to update then chart and then call itself 15 seconds later
quickieScript = Expr(
//Load the chart in the window (run the script in the function)
UpdateData();
//Run this same script in 5 seconds
Schedule( 5, quickieScript );
);
//Start things off:
quickieScript;