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

How to set default wrap text size to text box in bivariate plot (or any other type)

When generating a bivariate plot (for example) - the text box size is to narrow for the inside writing. 

After running the script i need to CTRL Right click the text box are and choose "Wrap Text" then choose the size i want. 

Is there any way to default choose the size? or any way to add to script to generate the plot with the desired wrap text size? 

 

 For example:
 text box result

edahari_0-1675674813648.png

Text box results i want 

edahari_1-1675674865412.png

The JSL code im using - Y,X can be what ever data numeric. legend in nominal like Hose_1, House_2, ... (ref line not important)

Bivariate(
	Y( :Y_column ),
	X( :X_column),
					
	by(),
	Automatic Recalc( 1 ),
	Group By(:Some_column),
	Fit Spline( 0.1, Standardized,{REPORT(0)} ),
					
	SendToReport(
		Dispatch({},"1",ScaleBox,{Format( "m/d/y", 10 ),	Interval( "Day" ), Inc( 4 ), Minor Ticks( 1 ),Rotated Labels( "Vertical" )}),
		Dispatch({},"2",ScaleBox,{Add Ref Line( eval(Some_Line_set_in_global), "DashDotDot", "Black", "UCL", 2 ),Add Ref Line( eval(Some_Line_set_in_global), "DashDotDot", "Black", "LCL", 2 )}),
		Dispatch({},"3",ScaleBox,{Rotated Labels( "Vertical" )}),
		Dispatch({},"Bivar Plot",FrameBox,{Marker Size( 1 ), Marker Selection Mode( "Unselected Faded" ),{Frame Size( 390, 270 ), Marker Size( MSB ), Line Width Scale( 1 )},
			Row Legend(:Some_column,Color( 1 ),Color Theme( "JMP Default" ),Marker( 0 ), Marker Theme( "" ),Continuous Scale( 0 ),Reverse Scale( 0 ),Excluded Rows( 0 ))}
		)	
	)
);

This  

1 ACCEPTED SOLUTION

Accepted Solutions

Re: How to set default wrap text size to text box in bivariate plot (or any other type)

Hello, This can be done as follows. You will want to read up on navigating JMP's "Display Tree" to see how reports are constructed, and the xPath ( ) command, for the convenience it affords.

 

What is needed here is to answer 2 questions:

1) In what type of structure does the text reside, and

2) How best to access these structures conveniently--all at once, if possible.

 

The << show tree structure message can help with 1), and xPath ( ) can often help with 2).

 

Run the following script. I've put a stop ( ) in it after using a << show tree structure message. Examine the tree structure and you will notice that the text you want to change lies in each of the TextEditBox structures subordinate to PictureBox( 2 ) in the report.

brady_brady_0-1675698899072.png

 

Knowing this, you would create the remainder of the script as I have. In the final script, of course, you would leave out the lines with rep << show tree structure and stop ( );

 

 

Names Default To Here(1);

dt = astable((1::20)` || ((3::60::3)` + J(20,1,randomnormal())), <<column names( {"x", "y"}));
dt << new column (repeat("group", 6), character, <<set values (repeat(words("abcd", ""), 5)));
	
biv = Bivariate(
	Y( :y ),
	X( :x ),
	Fit Where(
		:groupgroupgroupgroupgroupgroup == "a",
		Fit Spline( 0.1, {Line Color( {212, 73, 88} )} )
	),
	Fit Where(
		:groupgroupgroupgroupgroupgroup == "b",
		Fit Spline( 0.1, {Line Color( {61, 174, 70} )} )
	),
	Fit Where(
		:groupgroupgroupgroupgroupgroup == "c",
		Fit Spline( 0.1, {Line Color( {66, 112, 221} )} )
	),
Fit Where( :groupgroupgroupgroupgroupgroup == "d", Fit Spline( 0.1, {Line Color( {66, 112, 221} )} ) ) ); rep = report(biv); rep << show tree structutre; stop (); ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Use the tree structure to notice where the smoothing fit descriptions lie. // They are in the 2nd picturebox of the report. //get the picture box holding the spline fit descriptions picBox = report(biv)[picturebox(2)]; // set the width of the textEditBoxes within the picture box, all at once, using xPath // width is in pixels... use something you know will be well long enough. ( picBox << xPath("//TextEditBox") ) << set wrap width ( 1000 );

Cheers,

Brady

View solution in original post

4 REPLIES 4

Re: How to set default wrap text size to text box in bivariate plot (or any other type)

Hello, This can be done as follows. You will want to read up on navigating JMP's "Display Tree" to see how reports are constructed, and the xPath ( ) command, for the convenience it affords.

 

What is needed here is to answer 2 questions:

1) In what type of structure does the text reside, and

2) How best to access these structures conveniently--all at once, if possible.

 

The << show tree structure message can help with 1), and xPath ( ) can often help with 2).

 

Run the following script. I've put a stop ( ) in it after using a << show tree structure message. Examine the tree structure and you will notice that the text you want to change lies in each of the TextEditBox structures subordinate to PictureBox( 2 ) in the report.

brady_brady_0-1675698899072.png

 

Knowing this, you would create the remainder of the script as I have. In the final script, of course, you would leave out the lines with rep << show tree structure and stop ( );

 

 

Names Default To Here(1);

dt = astable((1::20)` || ((3::60::3)` + J(20,1,randomnormal())), <<column names( {"x", "y"}));
dt << new column (repeat("group", 6), character, <<set values (repeat(words("abcd", ""), 5)));
	
biv = Bivariate(
	Y( :y ),
	X( :x ),
	Fit Where(
		:groupgroupgroupgroupgroupgroup == "a",
		Fit Spline( 0.1, {Line Color( {212, 73, 88} )} )
	),
	Fit Where(
		:groupgroupgroupgroupgroupgroup == "b",
		Fit Spline( 0.1, {Line Color( {61, 174, 70} )} )
	),
	Fit Where(
		:groupgroupgroupgroupgroupgroup == "c",
		Fit Spline( 0.1, {Line Color( {66, 112, 221} )} )
	),
Fit Where( :groupgroupgroupgroupgroupgroup == "d", Fit Spline( 0.1, {Line Color( {66, 112, 221} )} ) ) ); rep = report(biv); rep << show tree structutre; stop (); ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Use the tree structure to notice where the smoothing fit descriptions lie. // They are in the 2nd picturebox of the report. //get the picture box holding the spline fit descriptions picBox = report(biv)[picturebox(2)]; // set the width of the textEditBoxes within the picture box, all at once, using xPath // width is in pixels... use something you know will be well long enough. ( picBox << xPath("//TextEditBox") ) << set wrap width ( 1000 );

Cheers,

Brady

edahari
Level I

Re: How to set default wrap text size to text box in bivariate plot (or any other type)

Im working with JMP14, It worked when i change the command the "set wrap width ( 1000 )" to "set wrap ( 1000 )"

Working great

 

Thank you 

Edan

edahari
Level I

Re: How to set default wrap text size to text box in bivariate plot (or any other type)

The script you gave my working great for a single report, but when using a report page with Expiration as the bivariant like so:

the variable gets an Expr of the Bivariant - for later use in a report window. 

Please see JSL attached 

It doesn't work

	Names Default To Here(1);

	dt = astable((1::20)` || ((3::60::3)` + J(20,1,randomnormal())), <<column names( {"x", "y"}));
	dt << new column (repeat("group", 6), character, <<set values (repeat(words("abcd", ""), 5)));
		
	biv_1 = expr(dt << Bivariate(
			Y( :y ),
			X( :x ),
			Fit Where(
				:groupgroupgroupgroupgroupgroup == "a",
				Fit Spline( 0.1, {Report( 0 ), Line Color( {212, 73, 88} ), Report( 0 )} )
			),
			Fit Where(
				:groupgroupgroupgroupgroupgroup == "b",
				Fit Spline( 0.1, {Report( 0 ), Line Color( {61, 174, 70} ), Report( 0 )} )
			),
			Fit Where(
				:groupgroupgroupgroupgroupgroup == "c",
				Fit Spline( 0.1, {Report( 0 ), Line Color( {66, 112, 221} ), Report( 0 )} )
			),
			Fit Where(
				:groupgroupgroupgroupgroupgroup == "d",
				Fit Spline( 0.1, {Report( 0 ), Line Color( {66, 112, 221} ), Report( 0 )} )
			)
		)
	);

	biv_2 = expr(dt << Bivariate(
			Y( :x ),
			X( :y ),
			Fit Where(
				:groupgroupgroupgroupgroupgroup == "a",
				Fit Spline( 0.1, {Report( 0 ), Line Color( {212, 73, 88} ), Report( 0 )} )
			),
			Fit Where(
				:groupgroupgroupgroupgroupgroup == "b",
				Fit Spline( 0.1, {Report( 0 ), Line Color( {61, 174, 70} ), Report( 0 )} )
			),
			Fit Where(
				:groupgroupgroupgroupgroupgroup == "c",
				Fit Spline( 0.1, {Report( 0 ), Line Color( {66, 112, 221} ), Report( 0 )} )
			),
			Fit Where(
				:groupgroupgroupgroupgroupgroup == "d",
				Fit Spline( 0.1, {Report( 0 ), Line Color( {66, 112, 221} ), Report( 0 )} )
			)
		)
	);

	/*Start - Report */
		output = New Window("The Report",
					Tab Box("Chart", 
						H List Box(biv_1, biv_2)
					)
		);

 

lala
Level VIII

Re: How to set default wrap text size to text box in bivariate plot (or any other type)

xPath ( ) 

Thanks!