cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Check out the JMP® Marketplace featured Capability Explorer add-in
Choose Language Hide Translation Bar
Dennisbur
Level IV

JSL Row Color

Hello

I have written the script in JSL, and the last point is to color row by SOFT_BIN

IF SOFT_BIN = 1 OR 2 >> Color all rows in Green

OTHER rows >> Color in Red

 

Dennisbur_0-1674745938869.png

 

And the second question is,

It's not exactly Red or Green color

I have attached the print screen where I chose the colors,

but how I can know the index of this color and use the shade of color it in the script?

 

Dennisbur_1-1674746150685.png

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: JSL Row Color

Coloring cells seems to be bit more work as you might have to loop over all columns, but this should work

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");

m_rows = dt << Get Rows Where(:sex == "M");
f_rows = dt << Get Rows Where(:sex == "F");

For Each({col}, dt << Get Column Names("String"),
	Column(dt, col) << Color Cells({{"Orange", m_rows}, {"Blue", f_rows}});
);
-Jarmo

View solution in original post

3 REPLIES 3
jthi
Super User

Re: JSL Row Color

There are quite a few different options, but one quick one is to color the rows by selecting some of the rows and right clicking on row number

jthi_0-1674748051741.png

Then select the color you are interested in. If you have JMP16+ and Enhanced Log enabled you can find the color there

// Set selected rows' colors
Data Table("Big Class") << Clear Select << Select Rows([1, 2]) <<
Colors("Light YellowGreen");

You could also set the same color as Value Colors column property and get it from enhanced log OR by copying column properties

jthi_1-1674748263853.png

Add Column Properties(
	Set Property("Notes", "Explore data adventurously"),
	Set Property("Value Colors", {"F" = 76, "M" = -4354269})
)

This can also be helpful Scripting Guide > Data Tables > Work with Rows > Row States (see Colors and Markers part) and Mark's Utility to Explore JMP Color Values 

-Jarmo
Dennisbur
Level IV

Re: JSL Row Color

Thank you for your assistance

Actually, this is a perfect way for what I wanted to do.

But I want to color all rows as I have shown in the first print screen

Can you tell me how I can do it by script?

 

Data Table("BIN PARETO") << Select Rows << Select where (:"SOFT_BIN" < 3) << Colors("Light YellowGreen");
Data Table("BIN PARETO") << Select Rows << Select where (:"SOFT_BIN" > 2) << Colors("Light Red");

 

Dennisbur_0-1674752267708.png

 

 

 

jthi
Super User

Re: JSL Row Color

Coloring cells seems to be bit more work as you might have to loop over all columns, but this should work

Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");

m_rows = dt << Get Rows Where(:sex == "M");
f_rows = dt << Get Rows Where(:sex == "F");

For Each({col}, dt << Get Column Names("String"),
	Column(dt, col) << Color Cells({{"Orange", m_rows}, {"Blue", f_rows}});
);
-Jarmo