Need help with automatic recal on bivariate chartUsing the big class sample data. I am trying to make an easy script that publishes y over x. It has an UCL set and the script also has automatic recalc set to on. I would like to have this script use the automatic recalc so when I do hide and exclude some data points it will adjust the y axis. But, if I want to hide and exclude points below the UCL (say anything greater than 100) I still want the y axis to adjust but not go lower than the UCL. Is there a way to do that?
Bivariate(
Y( :weight ),
X( :height ),
Automatic Recalc( 1 ),
SendToReport( Dispatch( {}, "2", ScaleBox, {Add Ref Line( 120, Solid, "Medium Dark Red", "UCL 120", 2 )} ) )
)Data Blending and CleanupRe: Need help with automatic recal on bivariate chartExactly what I need. Thank you.Re: Need help with automatic recal on bivariate chartI believe it was my misreading, but try the one below. I think it is close to what you want, and if not, you should be able to tweak it to meet the logic you need.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
biv = Bivariate(
Y( :weight ),
X( :height ),
Automatic Recalc( 1 ),
SendToReport(
Dispatch( {}, "2", ScaleBox, {Add Ref Line( 120, Solid, "Medium Dark Red", "UCL 120", 2 )} )
)
);
Report( biv )[FrameBox( 1 )] << add graphics script(
If( Col Max( If( Excluded( Row State( Row() ) ) == 1, ., :weight ) ) < 120,
Report( biv )[AxisBox( 1 )] << Max( 125 ),
Report( biv )[AxisBox( 1 )] << Max( Col Max( If( Excluded( Row State( Row() ) ) == 1, ., :weight ) ) )
)
);Re: Need help with automatic recal on bivariate chart@txnelson provided you the solution, just change the Min to the Max.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
biv = Bivariate(
Y( :weight ),
X( :height ),
Automatic Recalc( 1 ),
SendToReport(
Dispatch( {}, "2", ScaleBox, {Add Ref Line( 120, Solid, "Medium Dark Red", "UCL 120", 2 )} )
)
);
Report( biv )[FrameBox( 1 )] << add graphics script(
If( (Report( biv )[AxisBox( 1 )] << get max) < 120,
Report( biv )[AxisBox( 1 )] << Max( 120 )
)
);
Another approach is to use a Row State Handler function. See below. If you are new to JSL, Jim's solution is a safer solution.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
::ymax = Col Max(:weight);
f = function({a}, ::ymax= Maximum( Col Max(:weight), 120) );
dt << Make RowState Handler(f);
biv = Bivariate(
Y( :weight ),
X( :height ),
Automatic Recalc( 1 ),
SendToReport(
Dispatch( {}, "2", ScaleBox,
{Add Ref Line( 120, Solid, "Medium Dark Red", "UCL 120", 2 )},
{Min( 60 ), Max( ::ymax ), Inc( 20 ), Minor Ticks( 0 )}
)
)
);
Re: Need help with automatic recal on bivariate chartActually, I may have described it poorly. I would like the max on the y axis to remain at the UCL when auto calc is used when there are no points above the UCL.Re: Need help with automatic recal on bivariate chartSomething like this might work
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
biv = Bivariate(
Y( :weight ),
X( :height ),
Automatic Recalc( 1 ),
SendToReport(
Dispatch( {}, "2", ScaleBox, {Add Ref Line( 120, Solid, "Medium Dark Red", "UCL 120", 2 )} )
)
);
Report( biv )[FrameBox( 1 )] << add graphics script(
If( (Report( biv )[AxisBox( 1 )] << get min) < 120,
Report( biv )[AxisBox( 1 )] << Min( 120 )
)
);