- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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
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?
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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}});
);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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
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
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
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}});
);