The best way to handle what you are wanting, is to use a Column Switcher
names default to here(1);
dt = Current Data Table();
Bivariate(
Y( :Y4 ),
X( :X ),
Fit Spline( 0.1, Standardized, {Line Color( {212, 73, 88} )} ),
Fit Spline( 10000, {Line Color( {61, 174, 70} )} ),
Column Switcher( :Y4, {:Y1, :Y2, :Y3, :Y4} ),
SendToReport(
Dispatch(
{},
"Bivar Plot",
FrameBox,
{Frame Size( 444, 359 ), Marker Size( 6 ),
Marker Drawing Mode( "Normal" ), Transparency( 0.5 ),
Row Legend(
Y2,
Color( 1 ),
Color Theme( "Blue to Gray to Red" ),
Marker( 0 ),
Marker Theme( "" ),
Continuous Scale( 1 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}
)
)
);
It allows one to interactively make changes to the graph, and then when a new column is selected all of the changes are applied to the new column.
If you still want to do this not using the Column Switcher, what you need to do, is in your Radio Box, when a new selection is made, you extract the Script for the Bivariate, and then parse the script, replacing the the old column name, with the new column name, delete the old Bivariate report, and then run the newly modified script.
Jim