Hi. I'm interested in knowing there is a scripting method to read the displayed values for an axis in graphbuilder and return them as a list. IOW, is there a function or a message that can "get" the axis values from a graphbuilder reference or an axis box? Something like: xval_lis = gb << Get X Axis Values.
For instance, suppose I have the following graph:

dt = Open("$SAMPLE_DATA/Big Class.jmp");
gb = Graph Builder(
Size(513, 406),
Show Control Panel(0),
Back Color("White"),
Variables(X(:age), X(:sex, Position(1)), Y(:weight)),
Elements(Points(X(1), Y, Legend(1)), Smoother(X(1), Y, Legend(2))),
Local Data Filter(
Add Filter(
columns(:age),
Where(:age == {12, 13, 14}),
Display(:age, Size(170, 96), List Display)
)
),
SendToReport(Dispatch({}, "", AxisBox, {Select}))
)Here, since the user has excluded certain ages using the local data filter, not all of the ages in the table are shown in x-axis. In this case I would like a way to read off which ages are actually displayed in the graph. This question applies only when a nominal or ordinal-type variable is used for the axis (no continuous variables).
I've considered the following scripting method:
1. Read the local data filter
2. Create a subset table of just the unfiltered rows
3. Use the Summarize function on that table to get my list of displayed axis values
ldf_str = ldf << Get Where Clause; //ldf = reference to local data filter in gb window
clause = Parse(Regex(ldf_str, "Select Where\((.+)\)$", "\1"));
r = dt << Get Rows Where(Eval(clause)); //dt = ref to main datable
dtsub = dt << Subset(//Invisible,
Selected Rows(0),
Rows(r),
Selected columns only(0)
);
Summarize(dtsub, xlev_lis = By(:age, :sex));
This method seems unwieldy though. Is there a command that can "get" the axis values from a graphbuilder reference or an axis box?
@nikles,
Not sure of your user scenario, however, if the user is actively filtering, they can also change the GraphBuilder structure, different roles, etc. So a Filter Change Handler would be more robust. Also note the Where Clause() does not capture the Inverse. The script and the TextBox of the Where captures the Inverse as a Not (!)

Below and attached is a script that gets the Xticks and prints them to the Log when the filter changes. Here is a screen shot of the embedded Log with comments (//) and extra line feeds.

Names Default to Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
gb = Graph Builder(
Size(513, 406),
Show Control Panel(0),
Back Color("White"),
Variables(X(:age), X(:sex, Position(1)), Y(:weight)),
Elements(Points(X(1), Y, Legend(1)), Smoother(X(1), Y, Legend(2))),
Local Data Filter(
Add Filter(
columns(:age),
Where(:age == {12, 13, 14}),
Display(:age, Size(170, 96), List Display)
)
),
SendToReport(Dispatch({}, "", AxisBox, {Select}))
);
//iftb = (report(gb)[PictureBox(1)]<<SIB></SIB>
Notes:
- Line 20 is commented; it shows how to get a handle to the Where TextBox.
- Key features of the function f used for the Filter Change Handler are the capabilties of the JMP implementation of Associative Array: multiple methods to define it; to get unique values in a list; almost any JMP object can be used as a key.
- Other key features are: dt[ zz, _xvar_] is a list of row values, and ldf << get filtered rows.