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

How to Show Header Graphs Using JSL?

Is there any way to set the Header Graphs to show using JSL?

 

I've searched the Scripting Index & help forums, and tried

dt << Show Header Graphs(1);

and similar variations with no luck.

 

Thanks!

2 ACCEPTED SOLUTIONS

Accepted Solutions
hogi
Level XI

Re: How to Show Header Graphs Using JSL?

With 

Preferences(Show summary graphs below column names( 1 ))

 

you can activate the summary graphs by default.

Open data tables aren't updated. So close them and reopen them.

View solution in original post

jthi
Super User

Re: How to Show Header Graphs Using JSL?

I think currently you will have to update your users' preferences (which is generally horrible idea like you did mention). There is a wish list item to have session/instance preferences Provide way to set session / instance preferences and presets (won't exactly work in this case if the table is already open without some tricks as the property won't be updated to already open tables).

 

You might want to create separate wish list item to provide us with option to enable/disable header graphs in a data table via scripting

 

Edit:

There seems to be a command to open/close them BUT it will just swap them around (boolean flag doesn't seem to do anything). So it might be a bit difficult to make it work in every case

Current Data Table() << close summary panels;

You can try checking user preferences but it won't work in every case (like if user has closed them)

Try(
	If(!Arg(Arg(Get Preference("Show summary graphs below column names"))),
		Current Data Table() << close summary panels;
	)
);
-Jarmo

View solution in original post

7 REPLIES 7
hogi
Level XI

Re: How to Show Header Graphs Using JSL?

With 

Preferences(Show summary graphs below column names( 1 ))

 

you can activate the summary graphs by default.

Open data tables aren't updated. So close them and reopen them.

mmt
mmt
Level II

Re: How to Show Header Graphs Using JSL?

Thanks very much!

mmt
mmt
Level II

Re: How to Show Header Graphs Using JSL?

Do you know if there's any way to do this without adjusting the user's preferences? This is for a script that will be distributed to others, and although this solution will work I would prefer my users don't have their preferences edited unwillingly. 

jthi
Super User

Re: How to Show Header Graphs Using JSL?

I think currently you will have to update your users' preferences (which is generally horrible idea like you did mention). There is a wish list item to have session/instance preferences Provide way to set session / instance preferences and presets (won't exactly work in this case if the table is already open without some tricks as the property won't be updated to already open tables).

 

You might want to create separate wish list item to provide us with option to enable/disable header graphs in a data table via scripting

 

Edit:

There seems to be a command to open/close them BUT it will just swap them around (boolean flag doesn't seem to do anything). So it might be a bit difficult to make it work in every case

Current Data Table() << close summary panels;

You can try checking user preferences but it won't work in every case (like if user has closed them)

Try(
	If(!Arg(Arg(Get Preference("Show summary graphs below column names"))),
		Current Data Table() << close summary panels;
	)
);
-Jarmo
mmt
mmt
Level II

Re: How to Show Header Graphs Using JSL?

I will add a wish list item for this request. 

 

In the meantime the workaround I've been using is to check the user's preference at the start of the script with the following: 

pref = Num(Word(3,Char(Get Preferences(Show summary graphs below column names)),"()"));

Within the body of the script I set the preference to 1:

Preferences(Show summary graphs below column names(1));

My script creates a window as a UI to where the user will open a table then click a button to execute another script. So I added to the window:

<< On Close(Preferences(Show summary graphs below column names(pref)))

So when the UI is closed it will return their preferences to whatever they had before they opened it. 

 

This will cause issues if the user edits their preference with the window open but I expect this would be a rare occurrence. 

 

Thanks for your help!

jthi
Super User

Re: How to Show Header Graphs Using JSL?

Luckily this isn't too annoying preference to be messing with (for example if someone were to start messing with my locale settings it would be so annoying that I would even consider stopping using JMP for some time (I do always keep backups of my preferences)).

 

You might want to consider saving that user preference to a temp file and load it from there when they re-run your script. JMP might for example crash or user might close JMP by using Exit JMP I always do by using Ctrl + Q (I'm not sure if On Close will trigger in this case). Of course this won't work if they change their setting before re-running your script or  don't rerun your script at all.

-Jarmo
hogi
Level XI

Re: How to Show Header Graphs Using JSL?

 

Try(
	If(!Arg(Arg(Get Preference("Show summary graphs below column names"))),
		Current Data Table() << close summary panels;
	)
);

 

 nice workaround for the issue with missing boolean option : )
thanks.
Along the idea: if the user doesn't get the summary opened by default, please open the summary for the current data table (assuming that the user didn't open it manually).

 

much better than my suggestion via the preferences:

- no interference with global user settings

- works for the current data table (!) (not just data tables which will be opened in future)