cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
The Discovery Summit 2025 Call for Content is open! Submit an abstract today to present at our premier analytics conference.
Choose Language Hide Translation Bar
View Original Published Thread

How to set a limit on the number of options displayed in the Column Switcher, with the rest accessible via scrolling?

BabyDoragon
Level II

When the alternatives for the column switcher are too long, it elongates the length of the graph. How can we set the column switcher to initially display fewer options, showing a maximum of only 5 items? Users can then scroll down to find more options if they want. As shown in the example below, displaying too many options at once stretches the entire chart.

dt = Open( "$SAMPLE_DATA/Employee Master.jmp" );

Graph Builder(
	Size( 534, 658 ),
	Show Control Panel( 0 ),
	Variables( X( :Unique Id ), Y( :Employee Id ) ),
	Elements( Points( X, Y, Legend( 3 ) ) ),
	Column Switcher(
		:Employee Id,
		{:Employee Id, :Job Code, :Position Code, :Intorg Hr, :Intorg Mgr, :Employee Name, :Address Line1,
		:Address Line2, :City, :State, :Citizenship Country, :Gender, :Gender Code, :Ethnicity Code,
		:Marital Status Code, :Minority Flag, :County, :Postal Code, :Valid From Date, :Hire Date, :Start Date,
		:Employee Number, :Birth Date, :Disability Flag, :Military Exp Date, :Minimum Amt, :Midpoint Amt,
		:Maximum Amt, :Pay Level Type, :Manager Name, :Intorg Hr1, :Mnmlev1, :Mnmlev2, :Mnmlev3, :Manager Id,
		:Job Title Txt, :Job Group Code, :Job Group Desc, :EEO Class Code, :Emp Level, :Exempt Status Code,
		:Employee Type Code, :Hours Per Week, :Employee Status Code, :Performance, :Disciplinary Action Flag,
		:FLSA Status Code, :Hourly Salary, :Monthly Salary, :Annual Salary, :Annual Salary Z, :Payroll,
		:Comratio, :Age, :Over40, :Age Range, :Yrs Of Service, :Length Of Service}
	)
);

BabyDoragon_0-1742197635120.png

For example, in the above image, only five items are displayed, while the rest are hidden beneath a scroll menu.

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User


Re: How to set a limit on the number of options displayed in the Column Switcher, with the rest accessible via scrolling?

You can use << Set N Lines

jthi_0-1742198014967.png

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Employee Master.jmp");

gb = dt << Graph Builder(
	Size(534, 658),
	Show Control Panel(0),
	Variables(X(:Unique Id), Y(:Employee Id)),
	Elements(Points(X, Y, Legend(3)))
);

cw = gb << Column Switcher(
	:Employee Id,
	{:Employee Id, :Job Code, :Position Code, :Intorg Hr, :Intorg Mgr, :Employee Name,
	:Address Line1, :Address Line2, :City, :State, :Citizenship Country, :Gender, :Gender Code,
	:Ethnicity Code, :Marital Status Code, :Minority Flag, :County, :Postal Code,
	:Valid From Date, :Hire Date, :Start Date, :Employee Number, :Birth Date, :Disability Flag,
	:Military Exp Date, :Minimum Amt, :Midpoint Amt, :Maximum Amt, :Pay Level Type,
	:Manager Name, :Intorg Hr1, :Mnmlev1, :Mnmlev2, :Mnmlev3, :Manager Id, :Job Title Txt,
	:Job Group Code, :Job Group Desc, :EEO Class Code, :Emp Level, :Exempt Status Code,
	:Employee Type Code, :Hours Per Week, :Employee Status Code, :Performance,
	:Disciplinary Action Flag, :FLSA Status Code, :Hourly Salary, :Monthly Salary,
	:Annual Salary, :Annual Salary Z, :Payroll, :Comratio, :Age, :Over40, :Age Range,
	:Yrs Of Service, :Length Of Service}
);

cw << Set N Lines(5);

 

-Jarmo

View solution in original post

1 REPLY 1
jthi
Super User


Re: How to set a limit on the number of options displayed in the Column Switcher, with the rest accessible via scrolling?

You can use << Set N Lines

jthi_0-1742198014967.png

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Employee Master.jmp");

gb = dt << Graph Builder(
	Size(534, 658),
	Show Control Panel(0),
	Variables(X(:Unique Id), Y(:Employee Id)),
	Elements(Points(X, Y, Legend(3)))
);

cw = gb << Column Switcher(
	:Employee Id,
	{:Employee Id, :Job Code, :Position Code, :Intorg Hr, :Intorg Mgr, :Employee Name,
	:Address Line1, :Address Line2, :City, :State, :Citizenship Country, :Gender, :Gender Code,
	:Ethnicity Code, :Marital Status Code, :Minority Flag, :County, :Postal Code,
	:Valid From Date, :Hire Date, :Start Date, :Employee Number, :Birth Date, :Disability Flag,
	:Military Exp Date, :Minimum Amt, :Midpoint Amt, :Maximum Amt, :Pay Level Type,
	:Manager Name, :Intorg Hr1, :Mnmlev1, :Mnmlev2, :Mnmlev3, :Manager Id, :Job Title Txt,
	:Job Group Code, :Job Group Desc, :EEO Class Code, :Emp Level, :Exempt Status Code,
	:Employee Type Code, :Hours Per Week, :Employee Status Code, :Performance,
	:Disciplinary Action Flag, :FLSA Status Code, :Hourly Salary, :Monthly Salary,
	:Annual Salary, :Annual Salary Z, :Payroll, :Comratio, :Age, :Over40, :Age Range,
	:Yrs Of Service, :Length Of Service}
);

cw << Set N Lines(5);

 

-Jarmo