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

Setting legend color pallet on graph builder

I have a script that creates a graph builder output with a dataset that has a variable number of items in the legend and variable number of frames.  I'm able to get the frame tree structure then format them but unable to format the legend.  I think I'm close but something is not functional in the very last line.

Here's an example script.

Names Default To Here( 1 );
dt = Open("$SAMPLE_DATA/Solubility.jmp");
dtstack = dt << Stack(
	columns(:Name( "1-Octanol" ),:Ether,:Chloroform,:Benzene,:Carbon Tetrachloride,	:Hexane	),
	Source Label Column( "Gas" ),
	Stacked Data Column( "Solubility" )
);

gbname = dtstack << Graph Builder(	Size( 668, 643 ),	Show Control Panel( 0 ),
	Variables( Y( :Solubility ), Wrap( :Gas ), Overlay( :Labels ) ),
	Elements( Points( Y, Legend( 12 ) ) )
);

frames = gbname << xpath("//FrameBox");  //gets frames, works
frames << set background color( -16512221 );  //formats frames, works
LegendPallet = gbname << xpath("//LegendBox"); //gets legend, i think this works
LegendPallet << Color Theme( "Pastel" ); //formats color theme --doesn't work.  I suspect an issue with my obj.
1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Setting legend color pallet on graph builder

Try

<< Categorical Color Theme( "Pastel" );

See the Scripting Index for an example

     Help==>Scripting Index         search on pastel

Jim

View solution in original post

2 REPLIES 2
txnelson
Super User

Re: Setting legend color pallet on graph builder

Try

<< Categorical Color Theme( "Pastel" );

See the Scripting Index for an example

     Help==>Scripting Index         search on pastel

Jim
SamKing
Level III

Re: Setting legend color pallet on graph builder

Thanks! Looks like my primary issue was that i was trying to work it through the legendbox name instead of the graph object.