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

JSL - Check box to select variable to then plot in graph builder

Hi everyone,

 

I am trying to make a script which would work this way:

1. Opens a new window showing "Select the parameters you want to plot" with a list of parameters with check box for each, and the operator would chose which ones he wants to plot by ticking them.

2. Then for the ones that are ticked, open a graph builder with the corresponding variables.

 

I am currently able to make the first step (new window and list with check boxes), and I know how to script to create a graph, but I miss the link between them ... I was initially thinking of calling each check box indivudally and then do a succession of "if" like "if cb1 is ticked, then do the graph, if not, then if cb2 is ticked etc ...". I tried the following script to train but it always displays "Failed" in the end no matter if I ticked the box, so it does not really check the box:

 

Names Default To Here( 1 );

New Window( "Choose the parameters to be plotted", 
cb1 = Check Box ("Parameter 1",0),
cb2 = Check Box ("Parameter 2",0)
);

wait(5);

If (cb1 == 1,
Graph Builder(
	Variables(
		X( :Name( "Process duration" ) ),
		Y( :Name( "Parameter 1" ) )	)	),

New Window( "Failed"));

Do you have any idea how to do that?

 

@martindemel 

15 REPLIES 15
Elofar
Level II

Re: JSL - Check box to select variable to then plot in graph builder

I'm not sure to understand
I see the point of using the column dialog to ask the operator to select the column but still I don't know how to link that with automatic graph building after?

Re: JSL - Check box to select variable to then plot in graph builder

Example:

 

Names Default to Here( 1 );

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

dialog = Column Dialog(
	col = Col List( "X, Factor", Min Col( 1 ), Max Col( 1 ) )
);

If( dialog["Button"] == -1, Throw( "User cancelled" ) );
Remove From( dialog );
Eval List( dialog );

x = col[1];

dt << Graph Builder(
	Size( 534, 454 ),
	Show Control Panel( 0 ),
	Variables( X( x ), Y( :weight ) ),
	Elements( Points( X, Y, Legend( 3 ) ) )
);
Thomas1
Level V

Re: JSL - Check box to select variable to then plot in graph builder

Thanks Martin, for this helpful script.

Re: JSL - Check box to select variable to then plot in graph builder

kudos goes to Mark
/****NeverStopLearning****/
Thomas1
Level V

Re: JSL - Check box to select variable to then plot in graph builder

Sorry for that. Meanwhile I did kudos Mark as well.
SpannerHead
Level IV

Re: JSL - Check box to select variable to then plot in graph builder

Simple and effective.  Nice!


Slán



SpannerHead