Hi,
I am trying to only display certain columns in the combo box as legends, but the current code I have takes the column one by one. Is there any way in which I can skip over certain columns?
For example, in this case, I only want :subject & :season in the legend list. Here's my code:
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Animals.jmp", invisible );
legend_list = {"subject", "season"};
gb_default = Expr(
Graph Builder(
Size( 544, 356 ),
Show Control Panel( 0 ),
Legend Position( "Bottom" ),
Fit to Window( "Off" ),
Variables( X( :species ), Y( :miles ), Color( :subject ) ),
Elements( Points( X, Y, Legend( 14 ) ) ),
SendToReport( Dispatch( {}, "400", LegendBox, {Orientation( "Horizontal" ), Sides( "Left" )} ) )
)
);
gb_change = Expr(
Graph Builder(
Size( 544, 356 ),
Show Control Panel( 0 ),
Legend Position( "Bottom" ),
Fit to Window( "Off" ),
Variables( X( :species ), Y( :miles ), Color( Column( dt, ycol ) ) ),
Elements( Points( X, Y, Legend( 14 ) ) ),
SendToReport( Dispatch( {}, "400", LegendBox, {Orientation( "Horizontal" ), Sides( "Left" )} ) )
)
);
nw = New Window( "Animals Monitoring ",
gb = gb_default;
lbcontent = Lineup Box( N Col( 10 ),
Spacer Box( Size( 1, 0 ) ),
Text Box( "Color: ", <<Set Font Size( 10 ) ),
ycb = Combo Box(
legend_list,
<<Set( 1 ),
<<Set Function(
Function( {},
ycol = ycb << Get;
gb << delete;
nw << Prepend( gb = gb_change );
)
)
)
);
);
Thanks for your help in advance.
dk