cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
sanch1
Level I

Running a script to automate changes on a graph builder report

I'm trying to write a script that will edit the font on a graph builder report. my code is below. When I have the graph report I want open, I open the script editor, run the script but nothing happens. New to writing/executing JSL scripts, working with JMP15. If there is a way to record a macro to do this, please let me know as well. Thanks in advance

// 1. Change the font of the x-axis on an open graph to bold size 12
Graph Builder(
	Show Control Panel( 0 ),
	Variables( X( :Column1 ), Y( :Column2 ) ),
	Elements( Points( X, Y, Legend( 1 ) ) ),
	SendToReport( Dispatch( {}, "Column1", ScaleBox, {Font Size( 12 ), Bold( 1 )} ) )
);
 
// 2. Change the font of any of the multiple y-axes on an open graph to bold size 12
Graph Builder(
	Show Control Panel( 0 ),
	Variables( X( :Column1 ), Y( :Column2, :Column3 ) ),
	Elements( Points( X, Y, Legend( 1 ) ) ),
	SendToReport(
		Dispatch( {}, "Column2", ScaleBox, {Font Size( 12 ), Bold( 1 )} ),
		Dispatch( {}, "Column3", ScaleBox, {Font Size( 12 ), Bold( 1 )} )
	)
);
 
// 3. Change the font of x-axis title, y-axis titles, and the graph title to bold size 14
Graph Builder(
	Show Control Panel( 0 ),
	Variables( X( :Column1 ), Y( :Column2 ) ),
	Elements( Points( X, Y, Legend( 1 ) ) ),
	SendToReport(
		Dispatch( {}, "Column1", ScaleBox, {Font Size( 14 ), Bold( 1 )} ),
		Dispatch( {}, "Column2", ScaleBox, {Font Size( 14 ), Bold( 1 )} ),
		Dispatch( {}, "Graph Title", TextEditBox, {Font Size( 14 ), Bold( 1 )} )
	)
);

 

1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Running a script to automate changes on a graph builder report

For each place in your code where the Font Size and Font Style are being set, change to use the structure I showed.

Jim

View solution in original post

3 REPLIES 3
txnelson
Super User

Re: Running a script to automate changes on a graph builder report

The element syntax is incorrect.  Try this syntax

Graph Builder(
	Show Control Panel( 0 ),
	Variables( X( :Column1 ), Y( :Column2 ) ),
	Elements( Points( X, Y, Legend( 1 ) ) ),
	SendToReport(
		Dispatch(
			{},
			"Column1",
			ScaleBox,
			{Label Row( {Set Font Size( 14 ), Set Font Style( "Bold" )} )}
		)
	)
);

Also, please use the JSL icon at the top of the Preview Window when entering JSL.  It allows the reader to more easily study the JSL

Jim
sanch1
Level I

Re: Running a script to automate changes on a graph builder report

Thank you for your reply. However, I don't understand the correction. Is this just for that one section of the code or does it apply to the whole thing? I tried running this and still nothing happens.

txnelson
Super User

Re: Running a script to automate changes on a graph builder report

For each place in your code where the Font Size and Font Style are being set, change to use the structure I showed.

Jim