formatColumnWhere
The formatColumnWhere
method applies color formatting to a column of the source table, based on user-specified conditions.
Syntax
table.formatColumnWhere(columnName, condition, formula)
Parameters
Parameter | Type | Description |
---|---|---|
columnName | String | The column name. |
condition | String | The condition expression. |
formula | String | Formulas to compute formats for columns or rows in the table; e.g., For decimal formats, the result must be a string, and the formula must be wrapped in the special internal
function |
Returns
A new table applies the specified formatting to the source table.
Examples
In the following example, we use formatColumnWhere
to paint the "Timestamp" column red where the value of X is between 2 and 5.
tt = timeTable("PT1S").update("X = ii")
result = tt.formatColumnWhere("Timestamp", cond="X > 2 && X < 5", formula="RED")
- result
- tt