untested, but split it up into smaller blocks like this:
dt1 = Data Table( "Formulation Change Review (new)" );
tab = (dt1 << Tabulate(
Add Table(
Column Table( Grouping Columns( :Lab RFT ), Statistics( Row % ) ),
Row Table( Grouping Columns( :Grade ) )
)
)) ;
dt2 = tab << Make Into Data Table;
gb = dt2 << Graph Builder(
Size( 1896, 951 ),
Show Control Panel( 0 ),
Show Legend( 0 ),
Variables(
X(
:Grade,
Order By( :Name( "Row %(Y)" ), Ascending, Order Statistic( "Mean" ) )
),
Y( :Name( "Row %(Y)" ) ),
Overlay( :Grade )
),
Elements( Bar( X, Y, Legend( 6 ), Label( "Label by Value" ) ) ),
SendToReport(
Dispatch( {}, "graph title", TextEditBox, {Set Text( "RFT % per grade" )} ),
Dispatch( {}, "Y title", TextEditBox, {Set Text( "RFT%" )} );
tab<<closewindow;
close(dt2,nosave);
// gb is the handle to the graphbuilder report
edit: There appear to be missing ) at the end of the graph builder section. Make sure you grab all of the JSL from the save-to-script-window when you paste it together.
edit 2: just before the close(dt2,nosave) you might want to
gb << journal;
gb<<closewindow;
because the graph builder report needs the table open but the journal is self contained. The journal'd graph is not connected to the data and can't do row selection.
Craige