Hi,
For a project I´m working on I have created a graph with time on the x-axis which shows a period of approx 24 hours. To visually illustrate when it is night time and day time I have added reference lines as shown in the below script and attached image.
Properties for x-axis column:
SableData << New Column(
"Time since first dose-[hours]",
Numeric, "Continuous",
Format("Best", 12),
Formula((:Date Time - :StartTime) / (60 * 60)),
Set Property("Spec Limits", {LSL(8), USL(20), Show Limits(0)}), Set Selected);
Creating graph, adding and configuring ref lines:
Oxygen consumption = SableData << Graph Builder(
Size( 1007, 689 ),
Variables(
X( :Name( "Time since first dose-[hours]" ) ),
Y( :Name("VO2-[ml/min]" )),
Overlay( :Treatment )
),
Elements( Line( X, Y, Legend( 21 ), Error Bars( "Standard Error" ) ) ),
SendToReport(
Dispatch( {}, "Graph Builder", OutlineBox, {Set Title( "Oxygen consumption" )} ),
Dispatch(
{},
"Time since first dose-[hours]",
ScaleBox,
{Min( 168 ), Max( 288), Inc( 2 ), Minor Ticks( 12 )}
),
Dispatch(
{},
"400",
ScaleBox,
{Legend Model(
21,
Properties( 0, {Line Color( 0 )}, Item ID( "A", 1 ) ),
Properties(
1,
{Line Color( 53 )},
Item ID( "B", 1 )
),
Properties(
2,
{Line Color( 37 )},
Item ID( "C", 1 )
),
Properties( 3, {Line Color( 0 )}, Item ID( "A", 2 ) ),
Properties(
4,
{Line Color( 53 )},
Item ID( "B", 2 )
),
Properties(
5,
{Line Color( 37 )},
Item ID( "C", 2 )
)
)}
),
Dispatch( {}, "Graph Builder", FrameBox, {Marker Size( 0 )} ),
Dispatch( {}, "400", LegendBox, {Set Title( "" )} )
)
);
Eval(
Substitute(
Expr(
Report( Oxygen consumption )[AxisBox( 1 )] << Add Ref Line( {__LSL__, __USL__}, "Solid", "Black", "", 1, 0.25 ) //try show limits(1) in spec limits
),
Expr( __LSL__ ), (SableData:Name( "Time since first dose-[hours]" ) << get property( "spec limits" ))["LSL"],
Expr( __USL__ ), (SableData:Name( "Time since first dose-[hours]" ) << get property( "spec limits" ))["USL"]
));
But now I have data covering two weeks and I would still like to illustrate visually when it is night and day. I can of course add these manually but and copy the script but I would like to do this in a robust manner.
Can I in any way add these extra properties to the "Time since first dose-[hours]" column or is it possible to create a separate data table including all limits and pull them into the data table in one go?
Thanks in advance.
Br Julie
