Hello
I tried to color in red the value "The First Bin Fail" in column "FIRST_BIN".
and JSL colored all the table in red
can you explain where I did go wrong in my script?
dt << Select where ( :FIRST_BIN == "The first Bin Fail") << Color Cells ("Light Red");
Provide a table how I need to color it:
Hi @Dennisbur,
I'm not an expert in JSL, but this looks more like setting a column property related to this value, and then apply Color cell by value :
// Change column property: FIRST_BIN
Data Table( "Untitled" ):FIRST_BIN << Set Property(
"Value Colors",
{"The first Bin Fail" = -13912408}
);
Wait( 1 );
:FIRST_BIN << Color Cell by Value( 1 );
There might be some improvement and changes (color, datatable name, ...) to do with this code, in order to better handle missing values or other possible values, but it does color in red those cell values :
I hope this will help you.
Scripting index has quite good examples on how to use << Color cells (it is used to color specific rows in specific column). Below is a slight modification from an example
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
rows_to_color = dt << Get Rows Where(:age == 13);
wait(1);
Column(dt, "age") << Color Cells("Red", rows_to_color);
Using Value Colors column property is also a good option like @Victor_G suggested
Hi @Dennisbur,
I'm not an expert in JSL, but this looks more like setting a column property related to this value, and then apply Color cell by value :
// Change column property: FIRST_BIN
Data Table( "Untitled" ):FIRST_BIN << Set Property(
"Value Colors",
{"The first Bin Fail" = -13912408}
);
Wait( 1 );
:FIRST_BIN << Color Cell by Value( 1 );
There might be some improvement and changes (color, datatable name, ...) to do with this code, in order to better handle missing values or other possible values, but it does color in red those cell values :
I hope this will help you.
Scripting index has quite good examples on how to use << Color cells (it is used to color specific rows in specific column). Below is a slight modification from an example
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
rows_to_color = dt << Get Rows Where(:age == 13);
wait(1);
Column(dt, "age") << Color Cells("Red", rows_to_color);
Using Value Colors column property is also a good option like @Victor_G suggested