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
jsrmfh
Level I

JMP 14.2 - JSL - Graph Builder Size Ignored Inside Boxes Sent to Journal

Full disclosure - I'm a bigger fan of the older graph plotting routines in JSL than Graph Builder but I'm making some honest attempts to switch.

 

I'm running into a problem where I'm dynamically adding graphs to a Journal and I'm trying to very tightly control the graph sizes so axes and values line up horizontally. I'm building an H List Box in JSL with several items, sending that H List Box to the Journal, and then doing the same thing on another parameter. However, when I use Graph Builder, the Size attributes appear to be completely ignored and all GraphBuilders end up in what appears to be 300x300px. When I build the graphs via other graphing routes (variability plots, control chart, overlay plot), this just doesn't happen. It works.

 

I tried going about this a different way and made some test code to do the exact same addition of the H List Box to a new window instead of the Journal and everything works as expected. See the image below with the incorrect Journal output on left and the correct "New Window" output on right. Anyone know what's going on here with the Journal and what steps need to be taken to mitigate?

jsrmfh_0-1598380137617.png

Windows JMP 14.2

 

Example test code using Big Class example data table.

//Uses BigClass example data

// Create array of parameters
ParameterArray = {"height", "weight"};
numbatches = nrows(Current Data Table());
wind = New Window( "Example");

// Loop through parameters
for (i = 1, i <= N Items(ParameterArray),i++,
	ColName = ParameterArray[i];
	
		// Create charts
	xBox = H List Box ();
	
	xBox << append(	gbbp = Graph Builder(
			Size( 150, 300 ),
			Show Control Panel( 0 ),
			Variables( Y( Column( ColName ) ), Overlay( :sex ) ),
			Elements( Box Plot( Y, Legend( 2 ) ) ),
			SendToReport(
				Dispatch(
					{},
					ColName,
					ScaleBox,
					{Label Row( {Major Grid Line Color( -14277081 ), Show Major Grid( 1 )} )
					}
				),
				Dispatch( {}, "400", LegendBox, {Set Title( "" )} )
			)
		);
	);
		
	xBox << append(	gb = Graph Builder(
			Size( 900, 300 ),
			Show Control Panel( 0 ),
			Legend Position( "Inside Left" ),
			Variables( X( :age ), Y( Column( ColName ) ), Overlay( :sex ) ),
			Elements( Line( X, Y, Legend( 32 ) ) ),
			SendToReport(
				Dispatch(
					{},
					"Graph Builder",
					OutlineBox,
					{Set Title( ColName || " Chart" )}
				),
				Dispatch(
					{},
					"graph title",
					TextEditBox,
					{Set Text( ColName || " Chart" )}
				),
				Dispatch( {}, "400", LegendBox, {Sides( "Left" )} )
			)
		);
	);


	// Save to journal
	xBox << journal;
	wind << append(xBox);

);

 

4 REPLIES 4
Jeff_Perkinson
Community Manager Community Manager

Re: JMP 14.2 - JSL - Graph Builder Size Ignored Inside Boxes Sent to Journal

I don't know if this will be the solution but try turning Fit to Window off.

 

2020-08-25_16-00-25.899.png

 

Graph Builder(
	Size( 457, 479 ),
	Fit to Window( "Off" ),
	Variables( X( :weight ), Y( :height ) ),
	Elements( Points( X, Y, Legend( 3 ) ), Smoother( X, Y, Legend( 4 ) ) )
);
-Jeff
jsrmfh
Level I

Re: JMP 14.2 - JSL - Graph Builder Size Ignored Inside Boxes Sent to Journal

Thanks Jeff,

That doesn't seem to fix it either. For anyone else who's having this problem I've simply circled around the issue by building a window and then sending that window to the Journal. Doing so feels hacky since we're circling through another part of the UI to get to the destination, but it gets the job done.

Also - I noticed that I had an extra variable in my code example which prevented its running. I've corrected the original post.

Re: JMP 14.2 - JSL - Graph Builder Size Ignored Inside Boxes Sent to Journal

Hi

 

I've just fallen across this, trying to put several box plots into a report with some other stuff. At least it's not just me!

 

Did this ever get fixed? Is it a bug or a feature?

 

How to do what you did ("build a window and then sending it to the journal")?

 

Struggling to get going with JSL as it seems to be ... a bit different to any other language I've used, and I haven't time to spend understanding it all in depth.

 

Is there a way of making a box plot that doesn't involve Graph Builder?

 

Struggling with the documentation as well, which doesn't help!

 

thanks

John

Re: JMP 14.2 - JSL - Graph Builder Size Ignored Inside Boxes Sent to Journal

I think the main reason for the sizing issue is that the reports are not part of a window at the time that they are journaled.  This should probably be considered a bug and I will report it, but one way to work around this is to simply reorder the commands to add the reports to the window and save the journal:

	// Add reports to window
	wind << append(xBox);
	// Save to journal
	xBox << journal;

Hope that helps,

-Dan