set_color_scale
Apply a gradient color scale to chart bars or table cells based on a measure, with an optional center color for diverging scales to highlight extremes.
Instructions
Apply a GRADIENT colour scale to a visual property driven by a measure - the signature enterprise feature. e.g. colour a table value's background light->dark by [Total Sales]. objectName/propertyName presets: dataPoint/fill (chart bars/columns), values/backColor (table/matrix cell background), values/fontColor (text colour). Pass a centerColor for a 3-colour (diverging) scale. Data min/max is auto-computed. For DISCRETE colour bands by value range instead, use set_conditional_formatting.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| measure | Yes | measure that drives the colour | |
| maxColor | No | hex colour for the high end | #16365C |
| maxValue | No | explicit data value for the high colour (omit for auto) | |
| metadata | No | for a TABLE/MATRIX column: the column's queryRef e.g. 'Dim_Product.Brand' so the colour scale targets that column's background. Omit for charts. | |
| midValue | No | explicit data value for the middle colour | |
| minColor | No | hex colour for the low end | #EAF1F7 |
| minValue | No | explicit data value for the low colour (omit for auto) | |
| pageName | Yes | ||
| objectName | No | dataPoint | values | (any formatting object) | dataPoint |
| visualName | Yes | ||
| centerColor | No | optional middle colour for a diverging scale | |
| measureTable | Yes | table that owns the measure | |
| propertyName | No | fill | backColor | fontColor | fill |
| reportSessionId | Yes |