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
penalah
Level II

Graph Builder User settings

Hello everyone,

 

Is there a way to code that the graph builder would ask the user questions such as axis range, titles, etc.,
 
Appreciate your help 
 
Thanks 
1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Graph Builder User settings

There is not a Graph Builder Wizard, that would automatically ask such questions of Graph Builder.  However, one can write such code using JSL to as those questions.  The question I will ask, is given that one can easily adjust all of those items interactively when the Graph Builder graphic is displayed, do you really need to ask those questions before the generation of the graph?

 

Here is a simple script that allows the user to set the max value for the Y axis.

Names Default To Here( 1 );
dt = Open( "$sample_data\big class.jmp" );

nw = New Window( "user input",
	<<modal,
	H List Box(
		Text Box( "what is the Y axis max " ),
		Spacer Box( size( 10, 0 ) ),
		objMax = Number Edit Box(
			.,
			10,
			<<SetFunction(
				Function( {this}, /* put my value into my sibling's display */
					theMax = objMax << get
				)
			)
		)
	)
);

gb = dt << Graph Builder(
	Size( 528, 456 ),
	Show Control Panel( 0 ),
	Variables( X( :weight ), Y( :height ) ),
	Elements( Points( X, Y, Legend( 3 ) ) )
);

Report( gb )[axisbox( 2 )] << Max( theMax );
Jim

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: Graph Builder User settings

There is not a Graph Builder Wizard, that would automatically ask such questions of Graph Builder.  However, one can write such code using JSL to as those questions.  The question I will ask, is given that one can easily adjust all of those items interactively when the Graph Builder graphic is displayed, do you really need to ask those questions before the generation of the graph?

 

Here is a simple script that allows the user to set the max value for the Y axis.

Names Default To Here( 1 );
dt = Open( "$sample_data\big class.jmp" );

nw = New Window( "user input",
	<<modal,
	H List Box(
		Text Box( "what is the Y axis max " ),
		Spacer Box( size( 10, 0 ) ),
		objMax = Number Edit Box(
			.,
			10,
			<<SetFunction(
				Function( {this}, /* put my value into my sibling's display */
					theMax = objMax << get
				)
			)
		)
	)
);

gb = dt << Graph Builder(
	Size( 528, 456 ),
	Show Control Panel( 0 ),
	Variables( X( :weight ), Y( :height ) ),
	Elements( Points( X, Y, Legend( 3 ) ) )
);

Report( gb )[axisbox( 2 )] << Max( theMax );
Jim
penalah
Level II

Re: Graph Builder User settings

Thank you for your response. It's not mandatory to ask the questions but to give/look more efficient I am finding the alternatives. 

 

Thank you for your help. It worked.