BookmarkSubscribe
Choose Language Hide Translation Bar
pen51
Community Trekker

Using a Column Switcher with an OpenGL Scene and Functions

Right now, I have a Combo Box to choose the settings for the attached openGL scene. The Combo Box chooses a value which is the name of a column, but then set through many different functions before updating the scene. I have only found documentation about using a Column Switcher with JMP graphs themselves, by just stepping through a list of the column names. Is there a way to identify a function for the column inside the Column Switcher? And then put the Column Switcher object within something like a Panel Box?

0 Kudos
4 REPLIES 4
Highlighted
txnelson
Super User

Re: Using a Column Switcher with an OpenGL Scene and Functions

There are ways to do column switching under your control.....you may have to create your own switching tool......which we all had to do before the column switcher existed.   However, your referenced "Attached OpenGL" was not attached.

Jim
pen51
Community Trekker

Re: Using a Column Switcher with an OpenGL Scene and Functions

I apologize, I meant "attached" like the Combo Box that affects the OpenGL scene, not an actual attached file. How would you go about creating your own column switcher tool? I'd think about starting with a loop with wait times, but a feature about the Column Switcher that I like is being able to also choose the value you want to see. 

0 Kudos
txnelson
Super User

Re: Using a Column Switcher with an OpenGL Scene and Functions

Here is a real simple example of building a home grown column switcher

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\Blood Pressure.jmp" );

colList = dt << get column names( numeric, string );
colList = Remove( colList, 1, 1 );
selectedCol = colList[1];
New Window( "switcher",
	HLB = H List Box(
		V List Box(
			Text Box( "Select New Column" ),
			CLB = Col List Box(
				dt,
				all,
				maxselected( 1 ),
				<<set data type( numeric ),
				<<set analysis type( continuous ),
				selectedCol = (CLB << get selected)[1];
				changeChart;
			)
		)
		
	)
);

changeChart = Function( {},
	Try( ow << delete );
	HLB << append( ow = Oneway( Y( Column( dt, selectedCol ) ), X( :Dose ) ) );
);
changeChart;

 

Jim
Craige_Hales
Staff (Retired)

Re: Using a Column Switcher with an OpenGL Scene and Functions

Jim's solution is good. You can't use the column switcher directly because it is designed to work with built-in platforms by asking them for their script, changing the switched variable in the script, and rerunning the script.

Craige
0 Kudos