cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
bittnere
Level II

Variables to use as axis max/min in data table graph builder script

 

 

I have the following lines in my script I am saving to the data table and then running to make a graph builder graph. When I run the graph from the script it uses the variables as the max and min for graph builder but if I run the script saved to the data table (say I give the table to someone else) it uses default max and min instead. Any recommendations?

 

 

min_val = col min(:col1);
max_val = col max(:col1);

// rest of graph builder function not included

Dispatch(
			{},
			"Y Axis Name",
			ScaleBox,
			{Min( min_val ), Max( max val )}
		)

 

 

I've tried several things but creating min_val and max_val as table variables and passing those to the dispatch felt like the most promising but no luck - defaults min and max are instead used.

Thanks in advance!

 

1 REPLY 1

Re: Variables to use as axis max/min in data table graph builder script

The Send to Report() and Dispatch() functions are intended to be used by JMP to save user customizations in a platform. The scripter should instead send messages directly to the object.

 

Names Default to Here( 1 );

// get example
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

// pre-determine new scale
y min = 80;
y max = 100;

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

// get reference to report layer with display boxes
gb rep = gb << Report;

// send cascade of messages to y axis
Wait( 3 );
gb rep[AxisBox(2)]
	<< Min( y min )
	<< Max( y max );