cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Sign-in to the JMP Community will be unavailable intermittently Dec. 6-7 due to a system update. Thank you for your understanding!
  • We’re retiring the File Exchange at the end of this year. The JMP Marketplace is now your destination for add-ins and extensions.
  • JMP 19 is here! Learn more about the new features.

Discussions

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

Programmatically access Legend Properties with JSL

I want to disable the default 'click-ability' feature of a legend. I can achieve this manually by selecting the legend properties (in a platform) and un-selecting the 'Enabled' checkbox. But how do I access these properties programmatically?

 

I tried making the change manually and subsequently 'saved script' using the RED triangle but it does not appear to record this property. 

Is it possible?

 

thickey_0-1612402874425.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Programmatically access Legend Properties with JSL

You can use gb << Show Tree Structure() to give idea of the elements and with that you can usually get idea how to access specific element

jthi_0-1612421485880.png

 

In this case you can access LegendBox this way:

gb_report = gb << Report; 
legend = gb_report[legendbox(1)];

and set property most likely with legend << Enabled(0)

 

Full example:

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
gb = dt << Graph Builder(
	Show Control Panel(0),
	Variables(X(:sex), Y(:height), Group X(:age)),
	Elements(Box Plot(X, Y, Legend(1)))
);

gb_report = gb << Report; 
legend = gb_report[legendbox(1)];
legend << Enabled(0);

 

-Jarmo

View solution in original post

1 REPLY 1
jthi
Super User

Re: Programmatically access Legend Properties with JSL

You can use gb << Show Tree Structure() to give idea of the elements and with that you can usually get idea how to access specific element

jthi_0-1612421485880.png

 

In this case you can access LegendBox this way:

gb_report = gb << Report; 
legend = gb_report[legendbox(1)];

and set property most likely with legend << Enabled(0)

 

Full example:

Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
gb = dt << Graph Builder(
	Show Control Panel(0),
	Variables(X(:sex), Y(:height), Group X(:age)),
	Elements(Box Plot(X, Y, Legend(1)))
);

gb_report = gb << Report; 
legend = gb_report[legendbox(1)];
legend << Enabled(0);

 

-Jarmo

Recommended Articles