Hi JMP Community,
It's my turn to be stumped by an apparently trivial project.
I'm trying to dynamically add V Lines to a Graph Builder plot and I'm getting rather unexpected results with the test script below:
Names Default to Here (1);
dt = New Table ("TEST",
New Column ("X", Set Values ([1,2,3,4,5])),
New Column ("Y", Set Values ([3,2,5,8,6]))
);
gb = dt << Graph Builder(
Fit to Window( "Off" ),
Level Frame Color( "Medium Dark Gray" ),
Level Spacing Color( "Medium Dark Gray" ),
Level Underline( 1 ),
Page Level Underline( 0 ),
Spacing Borders( 1 ),
Variables( X( :X ), Y( :Y ) ),
Elements( Points( X, Y, Legend( 5 ) ) )
);
gbr = gb << report;
Ypos1 = 2;
Ypos2 = 6;
For (i = 1, i<=5, i++,
Xpos = i;
gbr [Framebox (1)] << Add graphics Script (
Pen color (Green);
V Line (1,4,6);
Pen color (Red);
V Line (Xpos, Ypos1, Ypos2);
Pen color (blue);
V Line (i, 6,8);
)
);
I get the green V Line correctly placed, I get one red V Line positioned at X = 5, and no blue line.
I tried adding Eval Expr (Expr()) for the entire expression and within the graphic script without success, so I'm sure that there is a simple solution that is escaping me at this late hour.
Any help would be greatly appreciated.
Thanks,
TS
Thierry R. Sornasse