Hello,
I’m trying to dynamically control multiple Y axes in Graph Builder based on a user Check Box selection.
Hard-coded Y variables work fine, but any dynamic construction fails (Y unresolved, ignored, or empty plot).
I’ve tried:
None work for me.
// Does NOT work
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
// Simulate user selection
Chosen_Ys_list = {"height", "weight"};
// Attempt to build Y list dynamically
Y_List = {};
For( i = 1, i <= N Items( Chosen_Ys_list ), i++,
Insert Into( Y_List, Expr( Y( Eval( Chosen_Ys_list[i] ) ) ) );
);
dt << Graph Builder(
Variables(
X( :age ),
Eval( Y_List ) // <- ignored or errors
)
);
// 2nd try
gb = dt << Graph Builder(
Variables( X( :age ) )
);
gb << Add Variable( Y( :height ) ); // Name Unresolved: Y