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

Column Switcher Resetting chart and removing script objects

Hi, Recently (after moving to JMP17) Whenever i use the column switch it resets the charts. removing the legend, reverting the graph size and removing the script object i placed on the graph. this has happened on the variability charts, but also a similar issue happened on contour plots where the column switcher actually duplicated the script object and removed legends. the only way to stop it from doing so was to remove the automatic recalc, this worked for the contour plot but not for other chart analysis.

how can I prevent this from happening and keep all my chart settings and script objects intact while scrolling though the column switcher?

3 REPLIES 3

Re: Column Switcher Resetting chart and removing script objects

Customized reports with Column Switcher (and other features) have been improved in many cases in JMP 18+.  The problems in earlier versions tended to happen when the column name that is being changed appears in the titles or the text of the display item that is customized.  The following script does not work in JMP 17, but it does work in JMP 18.

 

dt = Open( "$SAMPLE_DATA/Variability Data/2 Factors Crossed.jmp" );
vc = dt << Variability Chart(
	Y( :Measurement ),
	X( :Operator, :part# ),
	Always use column properties( 1 ),
);
cs = vc << Column Switcher( :Measurement, {:Measurement, :Standard} );
Wait(1);
Report(vc)[FrameBox(1)] << Frame Size(400,200);
Report(vc)[FrameBox(2)] << Frame Size(400,200);
Wait(1);
cs << Set Current("Standard");

 

In the variability report, there are a number of cases where column names are used in titles or labels.  When the name is used by itself, customizations may be working fine.  The more common problem case is when the name is embedded in another string, as in the Outline titles here:

 

danschikore_0-1713456404908.png

 

Unfortunately the only solution for JMP 17 and earlier is to use a JSL switcher callback script to reapply the customizations.

Re: Column Switcher Resetting chart and removing script objects

Can you possibly share an example of a JSL switcher callback script used to re-apply customizations? Im not that experience and not familiar with this solution. Thank you for the explanation 

Re: Column Switcher Resetting chart and removing script objects

Hi @ChiSquareShark9 - below is an expanded version of the script above that resets the frame sizes each time the column switcher is invoked.  In JMP 17 there is a brief flicker as the frames go back to default size and then are changed back to the desired size.  In JMP 18, there is no flicker and the callback handler is not necessary.  In that case the frame sizes are retained during the new platform launch.

 

NamesDefaultToHere(1);
dt = Open( "$SAMPLE_DATA/Variability Data/2 Factors Crossed.jmp" );
vc = dt << Variability Chart(
	Y( :Measurement ),
	X( :Operator, :part# ),
	Always use column properties( 1 ),
);
cs = vc << Column Switcher( :Measurement, {:Measurement, :Standard} );
Wait(1);
Report(vc)[FrameBox(1)] << Frame Size(400,200);
Report(vc)[FrameBox(2)] << Frame Size(400,200);
Wait(1);
pre = Function( {currentColumn, nextColumn, switcher},
	size1 = Report(vc)[FrameBox(1)] << Get Size;
	size2 = Report(vc)[FrameBox(2)] << Get Size;
);
post = Function( {previousColumn, currentColumn, switcher},
	Report(vc)[FrameBox(1)] << Frame Size(size1[1], size1[2]);
	Report(vc)[FrameBox(2)] << Frame Size(size2[1], size2[2]);
);
handler = cs << Make Column Switch Handler( pre, post );