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

Change legend font color in graph builder

Hey guys,

 

im creating some graphs and I wanted to change the font color of my legend to black (standard is white). Since I want to use the Legend within my graph (background color is white), you can't see the legend at all. I couldn't find out, how to change the legend font color in jmp.

 

I hope you can help me!

 

Greetings,

Bastian

2 REPLIES 2
ih
Super User (Alumni) ih
Super User (Alumni)

Re: Change legend font color in graph builder

I am not sure how to do this through the user interface, but you can change it with a script:

 

Names default to here(1);

dt = Open( "$Sample_data/iris.jmp" );

gb = Graph Builder(
	Size( 531, 456 ),
	Show Control Panel( 0 ),
	Legend Position( "Inside Right" ),
	Variables( X( :Sepal length ), Y( :Sepal width ), Overlay( :Species ) ),
	Elements( Points( X, Y, Legend( 4 ) ) )
);

//Use XPath to find all LegendBoxes (there is only one), pick the first
//one that is returned, and set its text color to red
(gb << XPath("//LegendBox"))[1] << Text Color("red")

That said, I'm not sure why yours defaults to white, here is the chart I get when running that script before setting the text color:

ih_0-1636502302407.png

 

 

Re: Change legend font color in graph builder

You can change this color with the user interface. Here is how to do it.

 

Right-click (Windows) or Command-Click (MacOS) on the gray triangle to the left of the Graph Builder outline at the top left and select Show Properties. Then select the legend in the display on the left of the new window. This action will highlight the properties for this display box on the left side. The second item in the list is the text color.

 

gb property.PNG