cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
View Original Published Thread

Scripting display box widths: OutlineBox & GraphBox

jb
jb
Level IV

I scripted a simple 2x2 scorecard (see attached JSL):

 

Scorecard.png

 

When I saved the journal to PDF and printed it, the display boxes had different widths:

  • OutlineBox - 3"
  • GraphBox - 2.88"

Is there a way to make the display boxes all the same width (e.g., 3") ?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
jb
jb
Level IV


Re: Scripting display box widths: OutlineBox & GraphBox

Thanks everyone for your suggestions.

 

I ended up changing the Bar chart widths (from 300 to 308).
The following structure worked the best for me:

VListBox(
  HListBox(
    OutlineBox( "X", TextBox("X",<<SetWidth(300)), ... ),
    GraphBuilder( Size(308,200), ... ), //Bar chart
    GraphBuilder( Size(308,200), ... )  //Bar chart
  ),
  HListBox(
    GraphBuilder( Size(308,200), ... ), //Bar chart
    OutlineBox( "X", TextBox("X",<<SetWidth(300)), ... ),
    OutlineBox( "X", TextBox("X",<<SetWidth(300)), ... )
  ),
  HListBox(
    OutlineBox( "X", TextBox("X",<<SetWidth(300)), ... ),
    GraphBuilder( Size(150,150), ... ), //Pie with legend
    OutlineBox( "X", TextBox("X",<<SetWidth(300)), ... )
  )
) 

 

View solution in original post

9 REPLIES 9


Re: Scripting display box widths: OutlineBox & GraphBox

You can use a LineupBox to organize DisplayBoxes in a grid where columns all have the same width. This would be instead of using V and H List Boxes as shown below.

win = New Window( "Customer Service Scorecard",
	Text Box(
		"Customer Service Scorecard",
		<<setFontSize( 16 ),
		<<SetFontStyle( "Bold" ),
		<<setWrap( 800 ),
		<<SetWidth( 600 ),
		<<JustifyText( "center" )
	),
	Text Box( "September 2017", <<setFontSize( 14 ), <<SetFontStyle( "Bold" ), <<setWrap( 800 ), <<SetWidth( 600 ), <<JustifyText( "center" ) ),
	Text Box( " " ),
	Lineup Box( N Col( 2 ),
		Outline Box( "Customer Satisfaction",
			Text Box( " " ),
			Text Box( "97%", <<setFontSize( 40 ), <<SetFontStyle( "Bold" ), <<SetWidth( 300 ), <<JustifyText( "center" ) ),
			Text Box( "of customers are satisfied", <<setFontSize( 9 ), <<SetWidth( 300 ), <<JustifyText( "center" ) )
		),
		dt1 << GraphBuilder(
			Size( 300, 200 ),
			ShowControlPanel( 0 ),
			ShowLegend( 0 ),
			Variables( X( :Channel ), Y( :Pct of Customers ) ),
			Elements( Bar( X, Y, Legend( 6 ) ) ),
			SendToReport(
				Dispatch( {}, "Graph Builder", OutlineBox, {Set Title( "Preferred Channels" )} ),
				Dispatch( {}, "Channel", ScaleBox, {Labe Row( LabelOrientation( "Angled" ) )} ),
				Dispatch( {}, "graph title", TextEditBox, {SetText( "" )} ),
				Dispatch( {}, "400", LegendBox, {SetTitle( "" )} )
			)
		),
		Outline Box( "Customer Compliments",
			Text Box( " " ),
			Text Box( "8", <<setFontSize( 40 ), <<SetFontStyle( "Bold" ), <<SetWidth( 300 ), <<JustifyText( "center" ) )
		),
		Outline Box( "Winning Interactions", Text Box( " ", <<SetWidth( 300 ) ), Data Table Box( dt2 ) )
	)
  
);
Justin
jb
jb
Level IV


Re: Scripting display box widths: OutlineBox & GraphBox

LineupBox did work for my example of a 2x2 grid of 4 charts.

 

However, I get weird results (vertically) when I use LineupBox for a 3x3 grid of assorted 9 charts:

 

image2.png

 

 

Any suggestions for the attached code (Scorecard2.jsl) ?

pmroz
Super User


Re: Scripting display box widths: OutlineBox & GraphBox

I suspect that JMP is centering each object vertically on the page, hence the apparent misalignment.  I don't know if there's a way to set the object to appear at the top of it's grid.

vince_faller
Super User (Alumni)


Re: Scripting display box widths: OutlineBox & GraphBox

if you put each of those outline boxes in a Vlistbox() with a spacerbox() underneath it.  It will line up.  

 

10-3-2017 12-58-24 PM.png

Vince Faller - Predictum


Re: Scripting display box widths: OutlineBox & GraphBox

@vince_faller, I was thinking of same thing yesterday with using the SpacerBox() to force the DisplayBoxes to be top aligned.

The one improvement I might suggest is to use a LineupBox of 1 column instead of a V List Box so that the width of the items are inherited. See attached.

Capture2.PNG

Justin
ian_jmp
Level X


Re: Scripting display box widths: OutlineBox & GraphBox

Perhaps I missed something, but maybe you can make rows with 'HListBox()', then use the 'Vertical Alignment(center)' message?

ian_jmp
Level X


Re: Scripting display box widths: OutlineBox & GraphBox

Sorry. Please disregard the post above. Now I see the columns don't line up . . .

vince_faller
Super User (Alumni)


Re: Scripting display box widths: OutlineBox & GraphBox

Didn't realize it inherited. Awesome.
Vince Faller - Predictum
jb
jb
Level IV


Re: Scripting display box widths: OutlineBox & GraphBox

Thanks everyone for your suggestions.

 

I ended up changing the Bar chart widths (from 300 to 308).
The following structure worked the best for me:

VListBox(
  HListBox(
    OutlineBox( "X", TextBox("X",<<SetWidth(300)), ... ),
    GraphBuilder( Size(308,200), ... ), //Bar chart
    GraphBuilder( Size(308,200), ... )  //Bar chart
  ),
  HListBox(
    GraphBuilder( Size(308,200), ... ), //Bar chart
    OutlineBox( "X", TextBox("X",<<SetWidth(300)), ... ),
    OutlineBox( "X", TextBox("X",<<SetWidth(300)), ... )
  ),
  HListBox(
    OutlineBox( "X", TextBox("X",<<SetWidth(300)), ... ),
    GraphBuilder( Size(150,150), ... ), //Pie with legend
    OutlineBox( "X", TextBox("X",<<SetWidth(300)), ... )
  )
)