Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
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

			"Y Axis Name",
			{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!



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

// 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 );
Learn it once, use it forever!
Article Labels

    There are no labels assigned to this post.