cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
0 Kudos

Show message if color range type set to Middle 90%

In Graph Builder, if the color range type is set to "Middle 90%", please can there be the option to include a message in the LegendBox to inform viewers of the chart that this range is in effect. At the moment, there is no indication when using a linear scale that outliers are being "hidden" in this way. A non-expert JMP user, or a recipient of a screenshot/flat image would have no way of knowing that this option has been selected.

 

In the image below I show an example 5-95% scale, plus a suggestion of the kind of informative text that could be included immediately under the scale.

 

matth1_0-1693316752270.png

It would be good to have this option accessible via JSL as well as interactively.

 

Many thanks,

Matthew.

1 Comment
matth1
Level IV

Having thought about my question further, this can be achieved quite simply in JSL as follows:

 

names default to here(1);
dt = open("$SAMPLE_DATA/Semiconductor Capability.jmp");

win01 = new window( "Demo",
	bb = button box( "Toggle color scale: full vs middle 90%", toggleScale ),
	gb1 = dt << Graph Builder(
		Size( 534, 362 ),
		Show Control Panel( 0 ),
		Variables( X( :PNP1 ), Y( :NPN1 ), Color( :PNP2 ) ),
		Elements( Points( X, Y, Legend( 5 ) ) ),
		SendToReport(
			Dispatch(
				{}, "400", ScaleBox,
				{Legend Model(
					5,
					Properties(
						0,
						{gradient(
							{Range Type( "Middle 90%" ), N Labels( 6 ), Width( 12 )}
						)},
						Item ID( "PNP2", 1 )
					)
				)}
			)
		)
	)
);

Report(gb1)["Graph Builder",LegendBox(1)] << sibappend(
	tb = text box("Color Scale:\!NMiddle 90% (5-95%)")
);
tb << text color( "Dark Gray" );

toggleScale = expr(
	server = gb1 << Get Legend Server;
	item = server << Get Legend Items( 1, 1 );
	rangeType = (item << Get Gradient Settings)[1][1]["Range Type"];
	if( rangeType == "Middle 90%",
		rangeType = "Exact Data Range"; tb << set text( "Color Scale:\!NExact Data Range" ),
		rangeType = "Middle 90%"; tb << set text( "Color Scale:\!NMiddle 90% (5-95%)" )
	);
	item << set properties(
		{gradient(Range Type( eval(substitute(expr( a ), expr( a ), rangeType ) ) ), N Labels(6))}
	);
);

matth1_1-1699869353731.png