cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Use World Cup data to build models, explore spatial relationships, and create informative visualizations in JMP. Register. July 17, 2 pm US Eastern Time.
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar
hogi
Level XIII

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?

2 ACCEPTED SOLUTIONS

Accepted Solutions
hogi
Level XIII

Re: 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

View solution in original post

jthi
Super User

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();

 

 

-Jarmo

View solution in original post

3 REPLIES 3
hogi
Level XIII

Re: 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
jthi
Super User

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();

 

 

-Jarmo
hogi
Level XIII

Re: Revert Graph Builder title ?

Nice, much better -  it doesn't create a new plot window.

Recommended Articles