In that case I consider building the column list dynamically within the table script
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");
table_script_expr = Expr(
cols = Current Data Table() << Get Column Names();
Remove From(cols, 1); // drop first column
gb = Graph Builder(
Size(528, 448),
Show Control Panel(0),
Variables(X(:lot_id), Y(Eval(cols[1]))),
Elements(Points(X, Y, Legend(3)))
);
gb << Column Switcher(
cols[1],
Remove(cols, 1)
)
);
Eval(EvalExpr(
dt << New Script("Graph",
Expr(NameExpr(table_script_expr))
);
));
You can avoid evaluation if you just create the graph and save that as script (I use this "trick" quite often)
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");
cols = dt << Get Column Names();
Remove From(cols, 1); // drop first column
gb = dt << Graph Builder(
Size(528, 448),
Show Control Panel(0),
Variables(X(:lot_id), Y(Eval(cols[1]))),
Elements(Points(X, Y, Legend(3))),
Column Switcher(
cols[1],
Remove(cols, 1)
),
Invisible
);
gb << Save Script to Data Table("Graph"); // this will remove the need for evaluation
wait(0);
gb << close window;
and if you wish to evaluate
// If you wish to evaluate, this should work even though the script will look a bit weird due to lack of ":" in columns
// If it doesn't you for some reason, you will have to build the list in a bit different manner for evaluation
Eval(EvalExpr(
dt << New Script("Graph2",
Graph Builder(
Size(528, 448),
Show Control Panel(0),
Variables(X(:lot_id), Y(Expr(cols[1]))),
Elements(Points(X, Y, Legend(3))),
Column Switcher(
Expr(cols[1]),
Expr(Remove(cols, 1))
)
)
)
));
-Jarmo