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?