cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Don’t miss your chance to experience Discovery Summit Europe at our best available rate! Early bird registration through 31 Oct.
  • Graph Builder Toolbar streamlines interactive graphing. Creates shortcuts on Report and GraphBuilder Helpers toolbars. Download and install the extension.
  • JMP will suspend normal business operations for our Rest and Recharge Day on Friday, October 2, 2026.
    Regular business hours will resume on Monday, October 5, 2026.

Discussions

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

Change Gradient Max with Slider box

Hello,

 

Is there a way to vary the Max value of the gradient using the slider box?

 

Jackie__0-1723230134817.png

 

Names Default To Here( 1 );

dt = Open( "$SAMPLE_DATA/Wafer Stacked.jmp" );
sliderValue = .6;
New Window( "", 
	
	
	H List Box(
		
		Panel Box( "Slider Box",
			tb = Text Box( "Gradient Maxium: " || Char( sliderValue ) ),
			sb = Slider Box( 0, 10, sliderValue, tb << Set Text( "Value: " || Char( sliderValue ) ) )
		), 	
		
		H List Box(
			Graph Builder(
				Size( 592, 569 ),
				Show Control Panel( 0 ),
				Variables( X( :X_Die ), Y( :Y_Die ), Color( :Defects ) ),
				Elements( Heatmap( X, Y, Legend( 5 ) ) ),
				SendToReport(
					Dispatch(
						{},
						"400",
						ScaleBox,
						{Legend Model( 5, Properties( 0, {gradient( {Min Lightness( 0 ), Width( 12 )} )}, Item ID( "Defects", 1 ) ) )}
					)
				)
			)
		)
	)
);
1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Change Gradient Max with Slider box

You can

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Wafer Stacked.jmp");
sliderValue = 0.6;

nw = New Window("", 
	H List Box(
		Panel Box("Slider Box",
			sb = Slider Box(0, 10, sliderValue, 
				vals = [.] || Matrix(sliderValue);
				Eval(EvalExpr(
					item << Set Properties({gradient({Scale Values(Expr(vals))})})
				));
			)
		), 	
		H List Box(
			gb = dt << Graph Builder(
				Size(592, 569),
				Show Control Panel(0),
				Variables(X(:X_Die), Y(:Y_Die), Color(:Defects)),
				Elements(Heatmap(X, Y, Legend(5))),
				SendToReport(
					Dispatch({}, "400", ScaleBox,
						{Legend Model(
							5,
							Properties(
								0,
								{gradient({Min Lightness(0), Width(12)})},
								Item ID("Defects", 1)
							)
						)}
					)
				)
			)
		)
	)
);

server = gb << Get Legend Server;
item = server << Get Legend Item(5, 1);
-Jarmo

View solution in original post

2 REPLIES 2
jthi
Super User

Re: Change Gradient Max with Slider box

You can

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Wafer Stacked.jmp");
sliderValue = 0.6;

nw = New Window("", 
	H List Box(
		Panel Box("Slider Box",
			sb = Slider Box(0, 10, sliderValue, 
				vals = [.] || Matrix(sliderValue);
				Eval(EvalExpr(
					item << Set Properties({gradient({Scale Values(Expr(vals))})})
				));
			)
		), 	
		H List Box(
			gb = dt << Graph Builder(
				Size(592, 569),
				Show Control Panel(0),
				Variables(X(:X_Die), Y(:Y_Die), Color(:Defects)),
				Elements(Heatmap(X, Y, Legend(5))),
				SendToReport(
					Dispatch({}, "400", ScaleBox,
						{Legend Model(
							5,
							Properties(
								0,
								{gradient({Min Lightness(0), Width(12)})},
								Item ID("Defects", 1)
							)
						)}
					)
				)
			)
		)
	)
);

server = gb << Get Legend Server;
item = server << Get Legend Item(5, 1);
-Jarmo
txnelson
Super User

Re: Change Gradient Max with Slider box

I believe you can do what you want by changing the Scale Values using a Set Gradient Scale Values message.  See the Scripting Index for description and examples.

Jim

Recommended Articles