Hi,
I'm trying to produce multiple graphs with a for loop, and assign the column title to the Y axis.
After graphing, I want to add three reference lines to the Y axis with a Dispatch command, but cannot figure out how to dynamically reference the Y axis box, see *** below:
For( i = 12, i <= 18, i++,
Col_name = Column( i ) << Get Name;
temp = Expr( Col_name );
//Graph Line Data
Split_dt << Graph Builder(
Size( 536, 500 ),
Variables( X( :Year ), X( :Month, Position( 1 ) ), X( :Day, Position( 1 ) ), Y( Column( i ) ) ),
Elements(
Box Plot( X( 1 ), X( 2 ), Y, Legend( 9 ), Jitter( 1 ), Outliers( 1 ), Box Style( "Outlier" ) )
),
SendToReport(
Dispatch(
{},
,
ScaleBox,
{Add Ref Line( 9, Solid, "Black", "LSL" ), Add Ref Line( 21, Solid, "Black", "USL" ),
Add Ref Line( 16, Dashed, "Medium Dark Green", "Target" )}
)
),
SendToReport(
Dispatch(
{},
"graph title",
TextEditBox,
{Set Text( "Line " || Char( Line_Number ) || " " || Col_name )}
)
)
);
);
This code returns the error "Cannot find ScaleBox[ "Col_name" ] at {}", as if JSL is evaluating Col_name as a string.
Any ideas on for to make Col_name evaluate to it's value, or add the ref lines differently?
Thanks!