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
Danial1
Level II

How do I ensure that my scalebox does not stay fixed in size

I kindly need help in to create a JSL script that does not make my variability chart scalebox stay fixed in one size because I'm having problems to see any values when the value is outside my control limits. Below is an image how the chart looks like for a given script. Appreciate it if someone could advise me how to let it ensure all the points inside this chart

 

Danial1_0-1609241441966.png

Variability Chart(
	Y( :chart_value ),
	X( :X, :Y, :link, :Z, :1, :2 ),
	Max Iter( 100 ),
	Conv Limit( 0.00000001 ),
	Number Integration Abscissas( 128 ),
	Number Function Evals( 65536 ),
	Analysis Type( "Choose best analysis (EMS REML Bayesian)" ),
	Connect Cell Means( 1 ),
	Std Dev Chart( 0 ),
	Where(
		:spc_chart_subset == "MEAN" & :measurement_set_name ==
		"U"
	),
	SendToReport(
		Dispatch(
			{"Variability Chart for chart_value"},
			"2",
			ScaleBox,
			{Min( -130 ), Max( 35 ), Inc( 20 ), Minor Ticks( 1 ),
			Add Ref Line( 0, "Dotted", "Medium Light Gray", "", 1 ),
			Add Ref Line( 26.21, "Solid", "Red", "UCL: 26.21", 1 ),
			Add Ref Line(
				-47.05,
				"Solid",
				"Medium Light Green",
				"Target: -47.05",
				1
			), Add Ref Line( -120.3, "Solid", "Red", "LCL: -120.3", 1 )}
		),
		Dispatch(
			{"Variability Chart for chart_value"},
			"Variability Chart",
			FrameBox,
			{Marker Size( 3 ), Row Legend(
				chart_incontrol_flag,
				Color( 1 ),
				Color Theme( "" ),
				Marker( 1 ),
				Marker Theme( "Solid" ),
				Continuous Scale( 0 ),
				Reverse Scale( 0 ),
				Excluded Rows( 0 )
			)}
		)
	)
);
3 REPLIES 3
txnelson
Super User

Re: How do I ensure that my scalebox does not stay fixed in size

I believe you will get what you want if you delete the Min(), Max() and Inc() references from the Scale Box definition, and let the platform determine what those settings should be for each run of the code.
Jim
Danial1
Level II

Re: How do I ensure that my scalebox does not stay fixed in size

Hi @txnelson. Its nice to have you on board. I did attempted what you advised before posting this. It nearly worked unfortunately after writing the following script, I'm unable to see my Upper Control Limit (UCL). 

Danial1_0-1609253997966.png

 

 

Variability Chart(
Y( :chart_value ),
X( :X, :Y, :link, :Z, :1, :2 ),
Max Iter( 100 ),
Conv Limit( 0.00000001 ),
Number Integration Abscissas( 128 ),
Number Function Evals( 65536 ),
Analysis Type( "Choose best analysis (EMS REML Bayesian)" ),
Connect Cell Means( 1 ),
Std Dev Chart( 0 ),
Where(
:spc_chart_subset == "MEAN" & :measurement_set_name ==
"U"
),
SendToReport(
Dispatch(
{"Variability Chart for chart_value"},
"2",
ScaleBox,
{ Minor Ticks( 1 ),
Add Ref Line( 0, "Dotted", "Medium Light Gray", "", 1 ),
Add Ref Line( 26.21, "Solid", "Red", "UCL: 26.21", 1 ),
Add Ref Line(-47.05,"Solid","Medium Light Green","Target: -47.05",1),
Add Ref Line( -120.3, "Solid", "Red", "LCL: -120.3", 1 )}
),
Dispatch(
{"Variability Chart for chart_value"},
"Variability Chart",
FrameBox,
{Marker Size( 3 ), Row Legend(
chart_incontrol_flag,
Color( 1 ),
Color Theme( "JMP Default" ),
Marker( 1 ),
Marker Theme( "Solid" ),
Continuous Scale( 0 ),
Reverse Scale( 0 ),
Excluded Rows( 0 )
)}
)
)
);

 

txnelson
Super User

Re: How do I ensure that my scalebox does not stay fixed in size

Are the reference lines you are specifying always set at the current values, for all of your charts?  And what you want is for the Y axis to change based upon the current data, but you want to make sure the reference lines are always displayed?

If this is the case, you will need to run the Variability Chart, check to see what the Y axis min and max are, and if they are not the size that will allow for the reference line to be displayed, then dynamically set them.

You will need to do something like

vc = Variability Chart(
	Y( :chart_value ),
	X( :X, :Y, :link, :Z, :Name( "1" ), :Name( "2" ) ),
	Max Iter( 100 ),
	Conv Limit( 0.00000001 ),
	Number Integration Abscissas( 128 ),
	Number Function Evals( 65536 ),
	Analysis Type( "Choose best analysis (EMS REML Bayesian)" ),
	Connect Cell Means( 1 ),
	Std Dev Chart( 0 ),
	Where( :spc_chart_subset == "MEAN" & :measurement_set_name == "U" ),
	SendToReport(
		Dispatch(
			{"Variability Chart for chart_value"},
			"2",
			ScaleBox,
			{Minor Ticks( 1 ), Add Ref Line( 0, "Dotted", "Medium Light Gray", "", 1 ),
			Add Ref Line( 26.21, "Solid", "Red", "UCL: 26.21", 1 ), Add Ref Line(
				-47.05,
				"Solid",
				"Medium Light Green",
				"Target: -47.05",
				1
			), Add Ref Line( -120.3, "Solid", "Red", "LCL: -120.3", 1 )}
		),
		Dispatch(
			{"Variability Chart for chart_value"},
			"Variability Chart",
			FrameBox,
			{Marker Size( 3 ), Row Legend(
				chart_incontrol_flag,
				Color( 1 ),
				Color Theme( "JMP Default" ),
				Marker( 1 ),
				Marker Theme( "Solid" ),
				Continuous Scale( 0 ),
				Reverse Scale( 0 ),
				Excluded Rows( 0 )
			)}
		)
	)
);
If(report(vc)[AxisBox(1)]<<get max, < 26.21, report(vc)[AxisBox(1)]<<max(27));
If(report(vc)[AxisBox(1)]<<get min, > -47.05, report(vc)[AxisBox(1)]<<min(-48));

Documentation on manipulating the output Display Tree is found in the JMP Documentation Library, in the Scripting Guide's section on Display Trees.

You can also see the definition of the messages that can be passed to the Axis Boxes in the Scripting Index entry for AxisBox.

Jim