Add ref line and column switcherHi all,
I have two questions:
1) when I switch column with column switcher, I can't add ref line anymore. for example
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
obj = dt << Bivariate( Y( :height ), X( :weight ) );
ColumnSwitcherObject = obj << Column Switcher( :height, {:name, :age, :sex, :height} );
gbReport = obj << report;<BR /><BR />axisbox = gbReport[axis box( 1)];now when I run the next line
axisbox << Add Ref Line(60, "Dotted", yellow, "TR", 2 );
It's working.
But if run this two lines
ColumnSwitcherObject << set current("age"); axisbox << Add Ref Line(14, "Dotted", yellow, "TR", 2 );
</CODE></P><P>It giving me this error</P><P> </P><PRE><CODE class="language-jsl">deleted object reference: axisbox << Add Ref Line(14, "Dotted", yellow, "TR", 2) in access or evaluation of 'Send' , axisbox << /*###*/Add Ref Line( 14, "Dotted", yellow, "TR", 2 ) /*###*/
In the following script, error marked by /*###*/
axisbox << /*###*/Add Ref Line( 14, "Dotted", yellow, "TR", 2 ) /*###*/
2) Is there a way to execute a script when switching columns in column switcher? Something like "makerowstatehandler" when we use local data filter?
Thanks.
Re: Add ref line and column switcherThe column switcher has the habit to drop its reference when a column is swapped out. By either embedding the reference line into the code
Bivariate(
Y( :height ),
X( :weight ),
SendToReport(
Dispatch(
{},
"2",
ScaleBox,
{Add Ref Line( 62.9375, "Dashed", "Yellow", "TR", 1 )}
)
)
);
or adding the code by using
<
I believe you can get around the issue
or
Re: Add ref line and column switcherThanks,
But it's showing me this error
axisbox << Add Ref Line( 14, "Dotted", yellow, "TR", 2 );
and not displaying the line
Re: Add ref line and column switcherFor #1, you need to re-run the line that sets the AxisBox variable first. This is because the Column Switcher in JMP re-generates the report when the column changes, so the old references to the report and axis box are no longer valid.
// Always needs to happen in this order
gbReport = obj << report;
axisbox = gbReport[axis box( 1 )];
axisbox << Add Ref Line(14, "Dotted", yellow, "TR", 2 );
For #2, I do not believe there is an equivalent handler for Column Switcher like there is for the Data Filter. This might be a good idea for the JMP Wish List.