cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
David_Burnham
Super User (Alumni)

Identifying Titles of Graph Builder Page Titles

In the following graph, I want to be able to identify the page titles:

David_Burnham_0-1634208979448.png

i.e. "sex = F" and "sex = M".

 

Looking at the display tree it would appear that the titles are associated with a display box of type GraphBuilderGroupBox:

David_Burnham_1-1634209205820.png

 

I have the following script:

Open("$SAMPLE_DATA/Big Class.jmp");

gb = Graph Builder(
	Size( 378, 714 ),
	Show Control Panel( 0 ),
	Show Legend( 0 ),
	Variables( X( :height ), Y( :weight ), Page( :sex ) ),
	Elements( Points( X, Y, Legend( 8 ) ), Smoother( X, Y, Legend( 9 ) ) )
);
rep = gb << report;

lst = rep << xpath("//GraphBuilderGroupBox");
for (i=1,i<=nitems(lst),i++,
	title = lst[i] << get text;
)


Unfortunately this doesn't work (title = "" for both pages).

 

Does anyone have any suggestions?

 

Thanks,

 

David

 

 

 

 

-Dave
1 ACCEPTED SOLUTION

Accepted Solutions
Craige_Hales
Super User

Re: Identifying Titles of Graph Builder Page Titles

Wow! That is one uncooperative box! Try using rep<<getJournal and hunting for LabelBox(label(\!"sex = F\!") stuff. At least in JMP 16, for the simple big class example, the LabelBoxes in the journal and the GraphBuilderGroupBoxes  seem to run in parallel.

 

@XanGreggthe box in question transforms itself into something friendlier when journaled. But in isolation, in the live graph builder, it won't say anything about itself.

Craige

View solution in original post

5 REPLIES 5
jthi
Super User

Re: Identifying Titles of Graph Builder Page Titles

This is one element I havent figured out how to directly access with Report layer or Xpath //GraphBuilderGroupBox << Get Window Title issue . Not sure if they could be built somehow using Get Variables

Open("$SAMPLE_DATA/Big Class.jmp");

gb = Graph Builder(
	Size( 378, 714 ),
	Show Control Panel( 0 ),
	Show Legend( 0 ),
	Variables( X( :height ), Y( :weight ), Page( :sex ) ),
	Elements( Points( X, Y, Legend( 8 ) ), Smoother( X, Y, Legend( 9 ) ) )
);
gbb = Report(gb)[Graph Builder Box(1)];
Show(gbb << get variables);
Show(gbb << get variable(1));
-Jarmo
Craige_Hales
Super User

Re: Identifying Titles of Graph Builder Page Titles

Wow! That is one uncooperative box! Try using rep<<getJournal and hunting for LabelBox(label(\!"sex = F\!") stuff. At least in JMP 16, for the simple big class example, the LabelBoxes in the journal and the GraphBuilderGroupBoxes  seem to run in parallel.

 

@XanGreggthe box in question transforms itself into something friendlier when journaled. But in isolation, in the live graph builder, it won't say anything about itself.

Craige
David_Burnham
Super User (Alumni)

Re: Identifying Titles of Graph Builder Page Titles

Thanks @Craige_Hales  - looks like this will be a workable solution.

-Dave
ih
Super User (Alumni) ih
Super User (Alumni)

Re: Identifying Titles of Graph Builder Page Titles

For page, group, and wrap variables you can set a column property defining the value order and then use that to be sure of which plot is which.  I often want to change the column or level names anyway and now this can all be done in a transform column:

 

 

Open("$SAMPLE_DATA/Big Class.jmp");

pageOrder = {"Female", "Male"};

Eval( Eval Expr(
	gb = Graph Builder(
		Size( 378, 714 ),
		Show Control Panel( 0 ),
		Show Legend( 0 ),
		Variables(
			X( :height ),
			Y( :weight ),
			Page( Transform Column( "Respondent Sex", Nominal, Set Property("Value Order", {Custom Order( Expr( pageOrder ))}), Formula( if(:sex=="M", "Male", "Female" ) ) ) )
		),
		Elements( Points( X, Y, Legend( 8 ) ), Smoother( X, Y, Legend( 9 ) ) )
	)
) );

Side note: The GraphBuilderGroupBox you referenced probably does not contain that text, note that if you set the visibility to hidden the heading is still there. I think this element just doesn't show up in the tree, sort of like how individual points aren't in there.  It would be nice if both were accessible!

 

David_Burnham
Super User (Alumni)

Re: Identifying Titles of Graph Builder Page Titles

Thanks for that suggestion @ih . The specific reason for wanting to get the titles of the pages is that I don't know ahead of time the list of potential values (i.e. pageOrder in this example).  In the real-world example the chart has over 400 pages (don't ask me why anyone wants a chart that size!) and the number of pages changes in reason to a local data filter.  If all else fails I will go back to trying to build that list - for my initial attempt my list contained about 460 elements and the graph only had 407 pages - perhaps some combinations were being excluded due to missing data - I've not investigated that yet - still trying to find the path of least resistance!

-Dave