As a way to learn JMP and a bit of JSL, I've been keeping track of Covid rates in my state. On a graph with new cases on the y and date on the x, I add a reference line at today's number of new cases as a sort of "we are here." Is there a way to automate this? I can tell that the "12601" and "12381" are the ones that need to change, but I don't know how to tell it to use the most recent values of "New Cases" (red) and "New Cases Rolling Average"(black).
Graph Builder(
Size( 1245, 660 ),
Show Control Panel( 0 ),
Fit to Window( "Maintain Aspect Ratio" ),
Variables(
X( :Date ),
Y( :New Cases ),
Y( :New Case Rolling Average, Position( 1 ) ),
Color( :Month )
),
Elements(
Line( X, Y( 1 ), Y( 2 ), Legend( 5 ) ),
Points( X, Y( 1 ), Y( 2 ), Legend( 6 ) )
),
SendToReport(
Dispatch(
{},
"New Cases",
ScaleBox,
{Min( -245.726960373999 ), Max( 19090.397676905 ), Inc( 2000 ),
Minor Ticks( 1 ), Add Ref Line( 0, "Solid", "Black", "", 1 ),
Add Ref Line( 12601, "Solid", "Red", "", 1 ),
Add Ref Line( 12381, "Solid", "Black", "", 1 )}
)
)
);