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
HubP_SDe
Level III

String formatting to customize chart Titles and Annotations

Dear Community,

 

Now that we reached a nice Application, we would like to customize charts Titles and add som Text Annotations, like Project & Scenario name, Description...

To make it nicer, I tried to insert a Line Feed control code into the string but it is displayed instead:

 

	SendToReport(
		Dispatch(
			{},
			"Distributions",
			OutlineBox,
			{Set Title( Eval( Char ( scenario ) ) || "\nIST Distribution" )}
		),
...

StringFormat.png

 

In idea if this is even feasible?

 

Thanks

Stéphane DELACROIX
Senior Simulation & Planning Engineer
2 ACCEPTED SOLUTIONS

Accepted Solutions
txnelson
Super User

Re: String formatting to customize chart Titles and Annotations

The escape sequence for new line is "\!n"

Jim

View solution in original post

txnelson
Super User

Re: String formatting to customize chart Titles and Annotations

It is documented in the Scripting Guide found in the JMP Documentation Library found under the Help pull down menu.

I did a "Whole Word" search on "new line" and found a reference to it

Write() sends the message that you specify to the log. Write() is the same as Print() except
that it suppresses the quotation marks around the text string, and it does not start on a new
line unless you include a return character yourself with the \!N escape sequence.
myText = "Here is a message.";
Write( "Here is a message." );
Here is a message.
Write( myText || " Do not forget to buy milk." ); // use || to concatenate
Write( "\!NAnd bread." ); // use \!N for return
Here is a message. Do not forget to buy milk.
And bread.
The sequence \!N inserts the line breaking characters that are appropriate for the host
environment. For an explanation of the three line breaking escape
Jim

View solution in original post

4 REPLIES 4
txnelson
Super User

Re: String formatting to customize chart Titles and Annotations

The escape sequence for new line is "\!n"

Jim
HubP_SDe
Level III

Re: String formatting to customize chart Titles and Annotations

Thanks a lot Jim, it worked fine!

Do you know where and how I could have found this information? (scripting index or online help, but what to search for?)
Stéphane DELACROIX
Senior Simulation & Planning Engineer
txnelson
Super User

Re: String formatting to customize chart Titles and Annotations

It is documented in the Scripting Guide found in the JMP Documentation Library found under the Help pull down menu.

I did a "Whole Word" search on "new line" and found a reference to it

Write() sends the message that you specify to the log. Write() is the same as Print() except
that it suppresses the quotation marks around the text string, and it does not start on a new
line unless you include a return character yourself with the \!N escape sequence.
myText = "Here is a message.";
Write( "Here is a message." );
Here is a message.
Write( myText || " Do not forget to buy milk." ); // use || to concatenate
Write( "\!NAnd bread." ); // use \!N for return
Here is a message. Do not forget to buy milk.
And bread.
The sequence \!N inserts the line breaking characters that are appropriate for the host
environment. For an explanation of the three line breaking escape
Jim
HubP_SDe
Level III

Re: String formatting to customize chart Titles and Annotations

Wonderful!

You just made me discover this huge PDF documentation.
I only used the Scripting Index, in which this same search gives nothing

Thanks again
Stéphane DELACROIX
Senior Simulation & Planning Engineer