- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
//GraphBuilderGroupBox << Get Window Title issue
Hi,
do you know how to get the GraphBuilderGroupBox "name" from the JSL scripting level? In attached picture it would be "Male" or "Female" (marked in red circles). My guess is to have a similar command to << xpath( "//GraphBuilderGroupBox" )) << Get Window Title. However it doesn't work.
Here is the code:
dt = Open( "$SAMPLE_DATA/Academic Achievement.jmp" );
win = dt << Graph Builder(
Size( 570, 475 ),
Variables( X( :Year4 ), Y( :Year2 ), Group X( :Female ) ),
Elements( Points( X, Y, Legend( 8 ) ), Smoother( X, Y, Legend( 9 ) ) )
);
GroupBoxName = (win << xpath( "//GraphBuilderGroupBox" )) << Get Window Title; //<<Class Name
Show( GroupBoxName );
I need it in my extended code, where I paste FrameBoxes from different tables on one GB. Frameboxes keep "correct" location as long as I do not use Local Data Filter, otherwise plotted data is messed up. I use JMP 16.1.
Thanks for your advices!
Regards,
Li
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: //GraphBuilderGroupBox << Get Window Title issue
No sure if you can access those "names" (groupings) from graph builder. You can check what you can access with Xpath by using << Get XML on win variable and based on that there is no mention of "Female" and "Male". Also checking from Show Tree Structure and Show Properties I cannot see them there either:
To get a reference to GraphBuilderGroupBox you can use:
gbgb = Report(win)[GraphBuilderGroupBox(1)];
//or
gbgb = (win << XPath("//GraphBuilderGroupBox"))[1]; //it is a list so use index
Accessing the Group X can be done with Variable, but I'm not sure if it will be helpful here:
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Academic Achievement.jmp");
win = dt << Graph Builder(
Size(570, 475),
Variables(X(:Year4), Y(:Year2), Group X(:Female)),
Elements(Points(X, Y, Legend(8)), Smoother(X, Y, Legend(9)))
);
//win << get xml
gbb = Report(win)[Graph Builder Box(1)];
wait(1);
gbb << Remove Variable(3);
gbb << Add Variable({:Female Binary, Role("Group X")});
Edit:
If you need just the values of Female column, you can get them directly from datatable. As these are value labels, you have to get value label property
(Column(dt, "Female") << Get Column Properties())["Value Labels"]