如何限制列切換器中顯示的選項數量,並透過捲動存取其餘選項?當列切換器的替代方案太長時,它會拉長圖的長度。我們如何設定列切換器最初顯示較少的選項,最多僅顯示 5 個項目?如果需要,用戶可以向下捲動以查找更多選項。如下例所示,一次顯示太多選項會拉伸整個圖表。
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}
)
);
例如,在上圖中,僅顯示五個項目,而其餘項目則隱藏在滾動式選單下方。
自動化和腳本回覆:如何限制列切換器中顯示的選項數量,其餘選項可透過捲動存取?您可以使用<<設定N行

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