Revert Graph Builder title ?When I change the title, in JSL a command
Dispatch( {}, {"graph title"}, TextEditBox, {Set Text( "xx" )} )
is added.
Is there a JSL command to revert the title in Graph Builder to the default value?
Automation and ScriptingData Exploration and VisualizationRe: Revert Graph Builder title ?my current workaround:
- get the script of the report
- close the report
- remove the command for the Graph Title from the retrieved script
- execute the changed code
Re: Revert Graph Builder title ?No idea if there is any way to revert that TextEditBox to default value but you could slightly modify your workaround. After executing the changed code (execute it inside V List Box or something so it won't create anything visible), pick the title from the "new" report, update your current one and then close the newly created one.
View more...
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
gb = dt << Graph Builder(
Size(528, 454),
Show Control Panel(0),
Variables(X(:height), Y(:weight)),
Elements(Points(X, Y, Legend(1)), Smoother(X, Y, Legend(2))),
SendToReport(
Dispatch({}, "graph title", TextEditBox, {Set Text("ABCD")})
)
);
reset_gb_title = Function({gb}, {Default Local},
s = gb << get script;
titlechange = Extract Expr(s, Dispatch({}, "graph title", TextEditBox, Wild()));
ngb = Substitute(Name Expr(s), Name Expr(titlechange), Expr(.));
vlb = V List Box(ngb = ngb);
default_title = Report(ngb)[TextEditBox(1)] << get text;
Report(gb)[TextEditBox(1)] << Set Text(default_title);
vlb << Delete Box();
Return(1);
);
wait(1); // demo purposes
reset_gb_title(gb);
Write();
Re: Revert Graph Builder title ?Nice, much better - it doesn't create a new plot window.