Stacked bar chart
The stacked bar chart widget breaks each bar into segments, so you can see both the total and how it splits across several series. It is ideal for composition — how the parts of a whole change across a category or over time.
Use it for:
- Platform share per day (Steam vs iOS vs Android stacked)
- Event volume split by app version over time
- Revenue composition by product line per month
Query requirements
Section titled “Query requirements”Return one label column (the X axis — a category or time bucket) followed by one numeric column per stacked series. Each numeric column becomes a stacked segment, and its column name appears in the legend.
The series must be known in advance, so use conditional aggregation (countIf, sumIf, uniqExactIf) — one expression per series.
Select
toDate(timestamp) AS date,countIf(platform = 'steam') AS "Steam",countIf(platform = 'ios') AS "iOS",countIf(platform = 'android') AS "Android"Filters
WHERE name = 'app_started'GROUP BY dateORDER BY dateResult shape:
| date | Steam | iOS | Android |
|---|---|---|---|
| 2026-04-01 | 120 | 85 | 43 |
| 2026-04-02 | 134 | 91 | 38 |
Each row stacks its Steam, iOS, and Android values into a single bar.
Display format
Section titled “Display format”Set Display format to percent to turn each bar into a 100% stacked bar — every segment is shown as its share of that bar’s total. Return raw counts; the normalization is handled for you.
Common examples
Section titled “Common examples”Platform composition per day
Select:
toDate(timestamp) AS date,countIf(platform = 'steam') AS "Steam",countIf(platform = 'ios') AS "iOS",countIf(platform = 'android') AS "Android"Filters: WHERE name = 'app_started' GROUP BY date ORDER BY date
Sessions by version per week
Select:
toStartOfWeek(timestamp) AS week,uniqExactIf(session_id, app_version = '1.7.9') AS "v1.7.9",uniqExactIf(session_id, app_version = '1.7.8') AS "v1.7.8"Filters: WHERE name = 'app_started' GROUP BY week ORDER BY week