cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Have your say in shaping JMP's future by participating in the new JMP Wish List Prioritization Survey
Choose Language Hide Translation Bar
KaylaSue
Level I

JSL - How to Assign Marker Color based on Conditional Value

I am trying to figure out how to script marker colors to specific rows based on a conditional value within one of the columns.

 

For instance, how would I make the marker color red for all rows with a "Hold Time" (column name) value of < 6 hours.

 

Note that I know how to do this from within a graph/graph builder, but I am trying to figure out to put it in a script to pre-emptively search for all values < 6 hours in the data table and color the rows accordingly such that if my imported data table gets updated with additional data, the script is able to perform the color coding automatically. 

1 REPLY 1
txnelson
Super User

Re: JSL - How to Assign Marker Color based on Conditional Value

Here is one way of doing it:

Names Default To Here( 1 );
dt = Current Data Table();
theRows = dt << get rows where( :Hold Time < 6 );
For Each( {targetRow}, theRows,
	Row State( targetRow ) = Color State( green )
);
Jim