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
Highlighted
atrautmann
Level II

How to use a column dialog list for column switcher?

Hello everyone,

I want to create a script where a list of columns is selected in a column dialog and, later on, appears in the column switcher of graph builder.

The column name is unspecific in order to use the script for different data tables. I started to write a small code, however, in this version the "column switcher columns" need to be selected by the user manually after closing the column dialog. I am quite new to JSL and would appreciate some help to solve this problem.

 

 

Names Default to Here(1);
dt = Current Data Table() << Get Column Names;

cd = Column Dialog(
	colx  = ColList( "X",  Max Col( 1 ), Modeling Type( "Continuous" ) ),
	coly  = ColList( "Y",  Min Col( 1 ), Modeling Type( "Continuous" ) ),);

Graph Builder(
	Size( 400, 300 ),
	Show Control Panel( 0 ),
	Variables( X( colx[1] ), Y( coly[1] ) ),
	Elements( Line( X, Y, Legend( 3 ) ) ),
	
	Column Switcher( coly[1] ) 
);

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
txnelson
Super User

Re: How to use a column dialog list for column switcher?

The Column Dialog requires a unique method for retrieving the values from the Window.  The following script is a rework of your script adding in the Column Switcher etc.

Names Default To Here( 1 );
dt = Current Data Table() << Get Column Names;

cd = Column Dialog(
	colx = ColList( "X", Max Col( 1 ), Modeling Type( "Continuous" ) ),
	coly = ColList( "Y", Min Col( 1 ), Modeling Type( "Continuous" ) ),

);
colx = cd["colx"];
coly = cd["coly"];

Graph Builder(
	Size( 400, 300 ),
	Show Control Panel( 0 ),
	Variables( X( colx[1] ), Y( coly[1] ) ),
	Elements( Line( X, Y, Legend( 3 ) ) ),
	Column Switcher( coly[1], coly )
);


Jim

View solution in original post

2 REPLIES 2
Highlighted
txnelson
Super User

Re: How to use a column dialog list for column switcher?

The Column Dialog requires a unique method for retrieving the values from the Window.  The following script is a rework of your script adding in the Column Switcher etc.

Names Default To Here( 1 );
dt = Current Data Table() << Get Column Names;

cd = Column Dialog(
	colx = ColList( "X", Max Col( 1 ), Modeling Type( "Continuous" ) ),
	coly = ColList( "Y", Min Col( 1 ), Modeling Type( "Continuous" ) ),

);
colx = cd["colx"];
coly = cd["coly"];

Graph Builder(
	Size( 400, 300 ),
	Show Control Panel( 0 ),
	Variables( X( colx[1] ), Y( coly[1] ) ),
	Elements( Line( X, Y, Legend( 3 ) ) ),
	Column Switcher( coly[1], coly )
);


Jim

View solution in original post

Highlighted
atrautmann
Level II

Re: How to use a column dialog list for column switcher?

Thanks a lot Jim for your prompt reply! Your solution works perfectly

Article Labels

    There are no labels assigned to this post.