turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- Change Graph Builder properties when using local d...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Jun 22, 2015 12:56 PM
(777 views)

Hi all,

I'm writing a script for a graph that will become a part of another function. The graph has X2 on the X-axis and a group y variable Y. I know I can set the number of levels for Y directly in the script, but I also have a local data filter with the graph so that the user can look at the effect of X2 & y for different values of another variable X. For different values of this variable X, the number of levels of Y can change. Is there a way in the JSL script to change the number of levels of Y in the graph when a new option in the local data filter is selected? I've been trying to use a row state handler, but can't seem to find the right function call to change the number of levels in the graph. Thanks for your help! Sarah

g = Graph Builder(

Show Control Panel( 0 ),

Variables( X( :X2), Group Y( :Y, Levels(10) ), Color( :Group ) ),

Elements( Points( X, Legend( 5 ), Jitter( 0 ) ) )

);

ldf= g << Local Data Filter(Mode, Add Filter(columns(:X), Display( :X , Single Category Display )));

doSomethingWithSelection = Function({x},

{Default Local},

rows = ldf << get filtered rows;

in = Column(dt, "Y") << get values;

in = in[rows];

numUniqueRows = nrow(getUniqueValues(in)); //separate function I wrote...

//change/update number of levels of y in graph g using numUniqueRows

);

gbReport = g << Report;

rsh = gbReport[OutlineBox(1)] << MakeRowStateHandler(doSomethingWithSelection);