Skip to content

Commit 748b3e1

Browse files
authored
docs: document color scale (heat mapping) for table charts (cube-js#11121)
* docs: document color scale (heat mapping) for table charts * docs: color scale treats nulls as zero by default * docs: correct color scale preset names and explain anchor modes
1 parent a67fa3c commit 748b3e1

1 file changed

Lines changed: 30 additions & 7 deletions

File tree

  • docs-mintlify/docs/explore-analyze/charts/chart-types

docs-mintlify/docs/explore-analyze/charts/chart-types/table.mdx

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,17 +117,40 @@ To make a background transparent, open the color picker and clear the hex value.
117117

118118
{/* TODO screenshot: conditional formatting panel with a condition configured (hidden — replace this comment with <Frame><img src="..." /></Frame> when image is ready) */}
119119

120-
### Gradient color scale
120+
### Color scale
121121

122-
The **Color scale** tab applies a gradient across a column based on value ranges. Configure a minimum color, a midpoint color (optional), and a maximum color. The gradient is applied across all visible rows.
122+
A **color scale** (heat map) tints each cell of a numeric column with a gradient based on where its value falls in the column's range. It is a rule type in the **Formatting** tab, alongside conditional formatting — switch a rule between **Conditional formatting** and **Color scale** with the **Type** selector inside the rule.
123123

124-
<Warning>
125-
If you don't set a mapping value for the scale, the gradient applies across visible rows only. This can produce unexpected results when row limits or pagination are active.
126-
</Warning>
124+
To add one quickly, open the menu next to **Add rule** and pick a color-scale preset:
127125

128-
Use the **Treat as zero** toggle to handle null values in the gradient calculation.
126+
- **Outstanding values** — a two-color scale that highlights the highest values.
127+
- **Divergent values** — a three-color scale that distinguishes low, middle, and high values.
128+
- **Traffic light gradient** — a red–yellow–green three-color scale.
129129

130-
{/* TODO screenshot: table with gradient color scale applied to a numeric column (hidden — replace this comment with <Frame><img src="..." /></Frame> when image is ready) */}
130+
A color scale requires a **numeric source column**. For non-numeric columns (strings, dates, booleans), the **Scale** type is disabled — use conditional formatting instead.
131+
132+
Configure the gradient with three stops, laid out top-to-bottom to mirror the column:
133+
134+
- **Start** (low end) — anchored at the column **Minimum** by default, or a custom **Number** or **Percentile**.
135+
- **Center** (optional middle) — **Disabled** by default, which produces a two-color gradient. Enable it for a three-color gradient anchored at the **Midpoint**, **Average**, **Median**, or a custom **Number** / **Percentile**.
136+
- **End** (high end) — anchored at the column **Maximum** by default, or a custom **Number** or **Percentile**.
137+
138+
Each stop has its own color. The anchor determines *which value* in the column the stop's color is pinned to:
139+
140+
- **Minimum** / **Maximum** — the lowest / highest value in the column.
141+
- **Midpoint** — the halfway point of the range, i.e. `(minimum + maximum) / 2`. Independent of how the values are distributed.
142+
- **Average** — the mean of all values (sensitive to outliers).
143+
- **Median** — the middle value when sorted (robust to outliers).
144+
- **Number** — a fixed value you enter.
145+
- **Percentile** — a value at the given percentile (e.g. `90` = the 90th percentile).
146+
147+
For the computed anchors (Minimum, Maximum, Midpoint, Average, Median), the dropdown previews the resolved value from your data.
148+
149+
Use **Reverse color scale** to swap the Start and End colors. **Treat nulls as zero** is on by default, coloring null/blank cells as zero; turn it off to leave them uncolored.
150+
151+
The scale is normalized **per column** — each targeted column uses its own value range.
152+
153+
{/* TODO screenshot: table with a color scale applied to a numeric column (hidden — replace this comment with <Frame><img src="..." /></Frame> when image is ready) */}
131154

132155
## Totals
133156

0 commit comments

Comments
 (0)