You can use << Row Legend to add new legend to FrameBox. The most difficult part in this is to remove the old one, below is one suggestion using XPath (might not be robust enougH)
//Get the current data Table
Names Default To Here(1);
dt = Current Data Table();
columnNames = dt << Get Column Names("String");
cl = New Window("Column Selection",
H List Box(
dist = dt << Distribution(
Continuous Distribution(Column(:IL_ALL_MAG_C1_S21), Normal Quantile Plot(1)),
SendToReport(
Dispatch({"IL_ALL_MAG_C1_S21"}, "", Picture Box(5), {Set Summary Behavior("Collapse")}),
Dispatch(
{"IL_ALL_MAG_C1_S21"},
"Distrib Quantile Plot",
FrameBox,
{Row Legend(
IL_ALL_MAG_C1_S21,
Color(1),
Color Theme("Spectral"),
Marker(0),
Marker Theme(""),
Continuous Scale(0),
Reverse Scale(0),
Excluded Rows(0)
)}
)
)
),
Panel Box("Make a selection",
allcolumn = Radio Box(columnNames, <<Set Function(Function({self},
cur_col = self << get selected;
(Dist<< XPath("//BorderBox/OwnerBox/PictureBox/TableBox/../../..")) << Delete Box; // might not be robust enough
fbox << Row Legend(
Eval(cur_col),
Color(1),
Color Theme("Spectral"),
Marker(0),
Marker Theme(""),
Continuous Scale(0),
Reverse Scale(0),
Excluded Rows(0)
);
)))
)
)
);
fbox = Report(dist)[FrameBox(1)];
-Jarmo