BookmarkSubscribeSubscribe to RSS Feed
david707

Occasional Contributor

Joined:

Feb 20, 2018

Change the text color of a single cell

Hi,

 

I have a script that looks at the data table DLD and then populates the data table CK with several rows of Pass/Fail. What I'd like it to do is for pass have the cell background color be green with black font and for fail have red cell background with white font. The color cells command is working fine, but I've been unable to find a syntax for changing font color that works after trying several things.

 

Thanks in advance for any help

 

		If(
			And(
				DLD:Current[1] >= DLD:LSL[1]
			,
				DLD:Current[1] <= DLD:USL[1]
			)
		,
			CK:PF[1] = "Pass";
			CK:PF << color cells(RGB Color( 0, 250, 0 ),{1});
		,
			CK:PF[1] = "Fail";
			CK:PF << color cells(RGB Color( 250, 0, 0 ),{1});
			CK:PF[1] << Format(Text Color("White"));		
		);
1 ACCEPTED SOLUTION

Accepted Solutions
gzmorgan0

Community Trekker

Joined:

Jul 25, 2016

Solution

Re: Change the text color of a single cell

Jim is correct there is no method to set a font color in a data table. This are just a couple of alternative suggestions:

  •  Use lighter colors, pass 36 [ Color To RGB(36) = {0.137254901960784, 0.905882352941176, 0.180392156862745}] and for fail use 35 [Color To RGB(35) = {1, 0.36078431372549, 0.462745098039216}] If the column is selected, the separation in colors in notable.
  • Create a report of text boxes. A TextBox can have different background and text colors and fonts. I didn't create a script for this.
  • Create a script to journal your table where only the pass green cells are colored. Then when journaled, make the table box rows selectable; select the fails, set the row selction color to red; then make the table box rows unselectable.  

Attached is a table with scripts. Instead of spec limits, I used a column of Cpk. There are 3 scripts attached.

  1. Set Cell Colors, uses the colors above, so you can see how they appear.
  2.  Create Report Table, colors the passing cells and the completes the steps described in bullet #3.
  3.  Clear Cpk Colors, does what its names declares, so you can start over.

It is interesting to note, if I changed the Cpk column to Data Type Expression, it is journaled a little differently. Maybe a wish list item is to be able to store HTML markup and expand JMP's current list of text markup to include font color, font and background color and maybe alignment. 

 

That's all I have.

2 REPLIES
Highlighted
txnelson

Super User

Joined:

Jun 22, 2012

Re: Change the text color of a single cell

The changing the font color in a JMP data table is not available.

Jim
gzmorgan0

Community Trekker

Joined:

Jul 25, 2016

Solution

Re: Change the text color of a single cell

Jim is correct there is no method to set a font color in a data table. This are just a couple of alternative suggestions:

  •  Use lighter colors, pass 36 [ Color To RGB(36) = {0.137254901960784, 0.905882352941176, 0.180392156862745}] and for fail use 35 [Color To RGB(35) = {1, 0.36078431372549, 0.462745098039216}] If the column is selected, the separation in colors in notable.
  • Create a report of text boxes. A TextBox can have different background and text colors and fonts. I didn't create a script for this.
  • Create a script to journal your table where only the pass green cells are colored. Then when journaled, make the table box rows selectable; select the fails, set the row selction color to red; then make the table box rows unselectable.  

Attached is a table with scripts. Instead of spec limits, I used a column of Cpk. There are 3 scripts attached.

  1. Set Cell Colors, uses the colors above, so you can see how they appear.
  2.  Create Report Table, colors the passing cells and the completes the steps described in bullet #3.
  3.  Clear Cpk Colors, does what its names declares, so you can start over.

It is interesting to note, if I changed the Cpk column to Data Type Expression, it is journaled a little differently. Maybe a wish list item is to be able to store HTML markup and expand JMP's current list of text markup to include font color, font and background color and maybe alignment. 

 

That's all I have.