cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • See how to interactively organize and restructure data for analysis. Register for May 29 webinar, 2pm US ET.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar

JSL add a title to Control charts

Hello, here a script to plot control charts (all the control limits are set by the user and this part of the code is not shown here). How can I modify the script to modify the title of the control chart?

 

Thank you very much!

 

		dt << Control Chart Builder(
			Size( 719, 464 ),
			Show Two Shewhart Charts( 0 ),
			Show Control Panel( 0 ),
			Show Capability( 0 ),
			Show Limit Summaries( 0 ),
			Variables( Subgroup( :column( Lot ) ), Y( :column( CQA ) ) ),
			Chart(
				Points( Statistic( "Individual" ) ),
				Add Spec Limits( {LSL( LSL_def ), USL( USL_def )} ),
				Set Control Limits( {LCL( LCL_def ), UCL( UCL_def ), Avg( Avg )} ),
				Warnings( Test 1( 1 ), Test 2( 1 ), Test 3( 1 ) )
			),
			SendToReport(
			
				Dispatch(
					{},
					Variable,
					ScaleBox,
					{Min( Min( LCL_def, LSL_def ) - 1 ), Max( Max( UCL_def, USL_def ) + 1 ), Inc( 1 ), Minor Ticks( 0 ),
					Add Ref Line( LSL_def, "Solid", "Blue", "LSL=" || Char( LSL_def ), 2 ), 
					Add Ref Line(
						USL_def,
						"Solid",
						"Blue",
						"USL=" || Char( USL_def ),
						2
					), 
					
					Add Ref Line( LCL_def, "Solid", "Red", "-" || Sigma || "σ=" || Char( LCL_val ), 1 ), Add Ref Line(
						UCL_def,
						"Solid",
						"Red",
						"+" || Sigma || "σ=" || Char( UCL_val ),
						1
					), 
					
					Add Ref Line( Avg, "", "Green", "µ=" || Char( Avg ), 1 ), Label Row( Set Font Style( "Bold" ) )}
				),
				Dispatch(
					{},
					"Control Chart Builder",
					FrameBox,
					{Add Graphics Script( 2, Description( "" ), Text( {10, 100}, "" ) ), Add Graphics Script(
						3,
						Description( "" ),
						Pen Color( "black" );
						V Line( Split - 0.5 );
					), Grid Line Order( 1 ), Reference Line Order( 4 ), DispatchSeg(
						TopSeg( 2 ),
						{Set Script(
							Pen Color( "black" );
							V Line( Split - 0.5 );
						)}
					)}
				)
			)
		)
1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: JSL add a title to Control charts

You can do this by simply referencing the text box that holds the title, and then update it.

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
dt << Control Chart Builder( Variables( Y( :height ) ), Show Control Panel( 0 ) );
Current Report()[Text Box( 1 )] << set text( "new title" )
;

txnelson_0-1668512972985.png

 

Jim

View solution in original post

4 REPLIES 4
txnelson
Super User

Re: JSL add a title to Control charts

You can do this by simply referencing the text box that holds the title, and then update it.

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
dt << Control Chart Builder( Variables( Y( :height ) ), Show Control Panel( 0 ) );
Current Report()[Text Box( 1 )] << set text( "new title" )
;

txnelson_0-1668512972985.png

 

Jim

Re: JSL add a title to Control charts

Thank you very much !

 

I have a last question. I want to change the title of the Control Chart according to the levels of my "Strength" variable.

I used your code and modify it:

 

 

summarize(dt,SubSet_Strength=by(:Strength));

Current Report()[Text Box( 1 )] << set text(Char( Variable)||" - "||Char( SubSet_Strength ) );

And I got the following result:

PersuasionCamel_0-1668525126820.png

How can I have the levels of my Strength variable with the commas, but without parenthesis and quotation marks?

 

Thank you!

 

txnelson
Super User

Re: JSL add a title to Control charts

Your Subset_Strength is a JMP List, not a character string.  You can use Concat Items() to take the elements of the list, an move them to a Character String, which can then be used as you want it.

Summarize( dt, SubSet_Strength = by( :Strength ) );

Current Report()[Text Box( 1 )] << set text( Char( Variable ) || " - " || Concat Items( Subset_Strength, ", " ) );
Jim

Re: JSL add a title to Control charts

Perfect! Thank you so much!

Recommended Articles