- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Shared Column Switcher for multiple graphs
Is there any way to have one shared column switcher for multiple graphs?
For example, I would like to have 1 column switcher to view two different variability charts...
Thank you for your help in advance.
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Shared Column Switcher for multiple graphs
Here is a script that works on JMP 13
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Blood Pressure.jmp" );
nw = New Window( "test",
ob = Outline Box( "Var Charts",
MyHLB = H List Box(
vc = Variability Chart( Y( :BP 8M ), X( :Subject ), Std Dev Chart( 0 ) ),
vc2 = Variability Chart( Y( :BP 8M ), X( :Subject ), Std Dev Chart( 0 ) )
)
)
);
cs = vc << Column Switcher( :BP 8M, {:BP 8M, :BP 12M, :BP 6M, :BP 8W, :BP 12W, :BP 6W, :BP 8F, :BP 12F, :BP 6F} );
nw["Var Charts"][listboxbox(1)] << set script(
VarList = {:BP 8M,:BP 12M,:BP 6M,:BP 8W,:BP 12W,:BP 6W,:BP 8F,:BP 12F,:BP 6F};
CurVar = word(2,char(vc2<<get script),":)");
Eval(
Substitute(
Expr( cs2 = vc2 << Column Switcher( __CurVar__, varlist )
),
Expr( __CurVar__ ), Parse( ":" || CurVar )
)
);
SwitchVar = Char((nw["Var Charts"][listboxbox(1)] << get selected)[1]);
For(i=1,i<=N items(VarList),i++,
If(SwitchVar==Char(VarList[i]),
Break()
)
);
nw["Var Charts"][listboxbox(2)]<<set selected(i);
cs2 << remove column switcher;
);
I tested it on JMP 11.1, and it works only for the first selection, then the link to the second Variability Chart gets lost. I assume this is a JMP bug that was fixed in JMP 12 or 13. However, all is not lost. What you can do, is to change my code to not generate a second Column Switcher and then use it to change the second chart, but instead, to delete the VC2 object completly, and then rebuild the chart and to append it to the MyHLB object.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Shared Column Switcher for multiple graphs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Shared Column Switcher for multiple graphs
I am not 100% clear what you mean by "platforms". I am using JSL scripts to plot two variability charts. I was able to add two column switcher to both variability charts (1 each), but I would like to have just one that controls both charts.
V List Box(
dt = Variability Chart(Set Title("Variability Chart 1"),Y(:colA),X(:colB)), dt = Variability Chart(Set Title("Variability Chart 2"),Y(:colA),X(:colB)))
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Shared Column Switcher for multiple graphs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Shared Column Switcher for multiple graphs
Here is a script that works on JMP 13
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Blood Pressure.jmp" );
nw = New Window( "test",
ob = Outline Box( "Var Charts",
MyHLB = H List Box(
vc = Variability Chart( Y( :BP 8M ), X( :Subject ), Std Dev Chart( 0 ) ),
vc2 = Variability Chart( Y( :BP 8M ), X( :Subject ), Std Dev Chart( 0 ) )
)
)
);
cs = vc << Column Switcher( :BP 8M, {:BP 8M, :BP 12M, :BP 6M, :BP 8W, :BP 12W, :BP 6W, :BP 8F, :BP 12F, :BP 6F} );
nw["Var Charts"][listboxbox(1)] << set script(
VarList = {:BP 8M,:BP 12M,:BP 6M,:BP 8W,:BP 12W,:BP 6W,:BP 8F,:BP 12F,:BP 6F};
CurVar = word(2,char(vc2<<get script),":)");
Eval(
Substitute(
Expr( cs2 = vc2 << Column Switcher( __CurVar__, varlist )
),
Expr( __CurVar__ ), Parse( ":" || CurVar )
)
);
SwitchVar = Char((nw["Var Charts"][listboxbox(1)] << get selected)[1]);
For(i=1,i<=N items(VarList),i++,
If(SwitchVar==Char(VarList[i]),
Break()
)
);
nw["Var Charts"][listboxbox(2)]<<set selected(i);
cs2 << remove column switcher;
);
I tested it on JMP 11.1, and it works only for the first selection, then the link to the second Variability Chart gets lost. I assume this is a JMP bug that was fixed in JMP 12 or 13. However, all is not lost. What you can do, is to change my code to not generate a second Column Switcher and then use it to change the second chart, but instead, to delete the VC2 object completly, and then rebuild the chart and to append it to the MyHLB object.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Shared Column Switcher for multiple graphs
Jim, Thank you so much. Let me work on this and i will let you know how your suggested workaround turns out!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Shared Column Switcher for multiple graphs
Thanks to your huge help, I was able to resolve the issue.
Rather than using your suggested workaround, I resolved the issue by addressing the bug directly.
Based on the error messaged, it looked to me that the bug on JMP11 was that the scriptable object gets "deleted" when you use Column Switcher.
So i just added readdressing line to reassign the object to the object name after the column has been switched.
For example,
nw["Var Charts"][listboxbox(2)]<<set selected(i);
vc2 =nw["Var Charts"][outline box("chart name")] << Get scriptable object;
cs2 << remove column switcher;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Shared Column Switcher for multiple graphs
Brilliant!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Shared Column Switcher for multiple graphs
I just want to highlight how powerful that particular use of << set script() is. I had been wondering for awhile how to get JMP to do something when changing selections in the column switcher, and this fits the bill perfectly.
nw["Var Charts"][listboxbox(1)] << set script(...)
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Shared Column Switcher for multiple graphs
Hi,
Is it possible to do that without script?
Thank in advance for responses