I am plotting graph and add refence line. I would like the reference line and Y max axis value can be seen on the graph. I am trying to set the Y axis max value based on the max cell value.
I do not see the Y max appear in the graph.
Below is my script. Can anyone advise what wrong with the script?
dt= Current Data Table();
MX = Max(:Weight);
If(
MX < 80,
MX = 90;
MX = MX + 10
);
dt << Overlay Plot(
X( :WW ),
Y( :Weight ),
Y Axis[1] << {{Max( MX ), Minor Ticks( 1 ),
Add Ref Line( 80, "Solid", "Red", "", 1 )}},
Separate Axes( 1 ),
Connect Thru Missing( 1 ),
Dispatch(
{},
"106",
ScaleBox,
{Max( MX ), Minor Ticks( 1 ),
Add Ref Line( 80, "Solid", "Red", "", 1 )}
),
Dispatch(
{},
"101",
ScaleBox,
{Min(0), Max( 11 ), Inc( 1 ), Minor Ticks( 1 )}
)
);