Solution
Use JSL to run a summary on the data. Take the summary values and insert them into the graph builder script.
dt = New Table( "Untitled",
Add Rows( 1e4 ),
New Column( "x1", Numeric, "Continuous", Format( "Best", 12 ), Formula( Random Normal( 400, 90 ) ) ),
New Column( "x2", Numeric, "Continuous", Format( "Best", 12 ), Formula( Random Normal( 600, 30 ) ) )
);
dtsummary = dt << Summary(
Mean( :x1 ),
Mean( :x2 ),
Std Dev( :x1 ),
Std Dev( :x2 ),
Freq( "None" ),
Weight( "None" )
);
x1Mean = dtsummary:name("Mean(x1)")[1];
x1StdDev = dtsummary:name("Std Dev(x1)")[1];
x2Mean = dtsummary:name("Mean(x2)")[1];
x2StdDev = dtsummary:name("Std Dev(x2)")[1];
gb = dt<<Graph Builder( Size( 512, 442 ), Show Control Panel( 0 ),
Variables( X( :x1 ), Y( :x2 ) ), Elements( Points( X, Y, Legend( 5 ) ) ),
SendToReport( Dispatch( {}, "x1", ScaleBox,
{Add Ref Line( x1Mean, "Dotted", "Red", "", 2 ),
Add Ref Line( x1Mean+x1StdDev, "Dotted", "Blue", "", 2 ),
Add Ref Line( x1Mean-x1StdDev, "Dotted", "Blue", "", 2 )
}
),
Dispatch( {}, "x2", ScaleBox,
{Add Ref Line( x2Mean, "Dotted", "Red", "", 2 ),
Add Ref Line( x2Mean+x2StdDev, "Dotted", "Blue", "", 2 ),
Add Ref Line( x2Mean-x2StdDev, "Dotted", "Blue", "", 2 )
}
),
Dispatch( {}, "Graph Builder", FrameBox,
{Marker Size( 1 ), Transparency( 0.5 )} ) )
);
report(gb)[framebox(1)]<<Size to Isometric;