Having some issues with both the local data filter & combo box fitting in. I am trying to build a tool for my company so I need the legend to be interactive, at the same time I want some to be able to put filters based on a column "season" in this example. But as I soon as I change the legend, the local data filter keeps expanding to down the graph. Would you know what I can do to improve this?
I've taken the animals data table as it's very small
dt = Open("$sample_data/Animals.jmp");
xlist = dt << Get Column Names( String );
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 ) ),
Local Data Filter(
Add Filter(
columns( :season ),
Display( :season, Size( 160, 60 ), List Display )
)
),
Elements( Points( X, Y, Legend( 23 ) ) ),
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 )) ),
Local Data Filter(
Add Filter(
columns( :season ),
Display( :season, Size( 160, 60 ), List Display )
)
),
Elements( Points( X, Y, Legend( 23 ) ) ),
SendToReport(
Dispatch(
{},
"400",
LegendBox,
{Orientation( "Horizontal" ), Sides( "Left" )}
)
)
));
nw = New Window( "Animal test ",
gb = gb_default;
lbcontent = Lineup Box( N Col( 10 ),
Spacer Box( Size( 1, 0 ) ),
Text Box( "Color: ", <<Set Font Size( 10 ) ),
ycb = Combo Box(
xlist,
<<Set( 2 ),
<<Set Function(
Function( {},
ycol = ycb << Get;
gb << delete;
nw << Prepend( gb = gb_change );
)
)
),
);
);
dk