Hello all,
I am using JMP15 since 1 year but I am just beginning to get interesting in scripts.
I would like to write a script to display References Lines in a graph, based on a table.
I have 2 tables : data (on which I run the script, to plot value=f(time)) and dates, containing one column with dates corresponding to the references lines I would like to have in the graph.
Those tables are attached to my post.
Here is my current script, displaying one reference line based on the first element of table dates, column date.
ref1 = dates:name( "date" )[1];
Graph Builder(
Variables( X( :time ), Y( :value ),Page(:cat) ),
Elements( Points( X, Y, Legend( 4 ), Summary Statistic( "Mean" ) ) ),
SendToReport( Dispatch( {}, "time", ScaleBox( 2 ), {Add Ref Line( ref1, "Dotted", "Red", "", 2 )} ) )
);
I would like to create a "For" loop to create automatically reference lines for each value of the table "dates".
Here is what I tried :
ref1 = dates:name( "date" )[1];
Graph Builder(
Variables( X( :time ), Y( :value ),Page(:cat) ),
Elements( Points( X, Y, Legend( 4 ), Summary Statistic( "Mean" ) ) ),
SendToReport( Dispatch( {}, "time", ScaleBox( 2 ),
{
For( i = 1, i <= N row( dates), i++,
f = dates [ i ];
Add Ref Line( f, "Dotted", "Blue", "", 2 )
);
})
);
But when I run the script, no reference line appears.
How can I solve this issue ?
Last question : if I do not add "Page(:cat)" in the graph variables, no reference line appears...
Thank you for your help !!