How to add reference line if you don't know what column you will useI'm stuck at a seemingly simple task.
I plot a Graph Builder where my Y axis isn't known yet, it's provided as a variable.
So what do I put in here instead of MyYVariable to draw a reference line regardless of what's on Y axis?
Dispatch(
{},
"MyYVariable",
ScaleBox,
{Add Ref Line(
0.1,
"Dotted",
"Medium Dark Green",
"0.1",
3,
1,
Label Settings( {Label Color( "Green" )} )
), Label Row(
{Label Orientation( "Vertical" ), Set Font( "OCR A Extended" )}
)}
)
ScriptingRe: How to add reference line if you don't know what column you will useIs the something wrong with your option2? If you are building graph builder, you should know column names and then you could most likely use Insert one expression into another using Eval Insert, Eval Expr, Parse, and Substitute or similar method to add the "name" there.
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
y_var = Column(dt, "height");
gb_expr = EvalExpr(gb = dt << Graph Builder(
Variables(Y(Expr(y_var))),
Elements(Points(Y, Legend(4))),
SendToReport(
Dispatch(
{},
Expr(y_var << get name),
ScaleBox,
{Add Ref Line(63.858764556962, "Solid", "Black", "", 1)}
)
)
));
show(gb_expr);
eval(gb_expr);Re: How to add reference line if you don't know what column you will useNothing wrong with neither mine or yours, I was just hoping that there is a generic way of doing that. Use case: I model GB using graph builder first, where I set up all the reference lines, and ideally just would copy the script. But now I need to delete that part and write it separately as my solution, or tweak it as in your solution.
Anyways, thanks for the input!