Skip to content

Turn a report into a chart

Any report can render as a chart by ending its query with RENDER <kind> and configuring it with WITH (...). A query with no RENDER clause renders as a table.

A Scout report rendered as a horizontal bar chart, ranking ten players by damage to champions.

Pick a kind that suits the shape of your data

Section titled “Pick a kind that suits the shape of your data”
  • Ranking a handful of thingsbar_chart, or leaderboard for text with mentions.
  • Change over timeline_chart or area_chart, grouped by day, week, or month.
  • Parts of a wholedonut_chart, and only when rows are few and actually sum to something meaningful.
  • Two dimensions at onceheatmap, grouped by two dimensions.
  • Comparing two numbers per rowscatter_chart.
  • One headline numberkpi_card with GROUP BY all.
  • Comparing several normalized metricsradar_chart, three to eight of them.

All twelve are listed in Render kinds and options.

WITH (...) binds your query’s outputs to chart channels:

select games, win_rate
from match_participants
group by champion
order by games desc
limit 10
render bar_chart with (y = games, orientation = horizontal)
  • y is the numeric series — up to eight of them, as y = (a, b).
  • x is the horizontal channel; it defaults to the grouping column.
  • value is the cell value for a heatmap or a KPI card.
  • size sizes scatter points.

A chart that renders empty or wrong is nearly always a y bound to something the query does not actually output — check that the name in WITH appears in the SELECT.

Group by a time dimension rather than a player or champion:

select games, win_rate
from match_participants
where queue in (solo, flex)
group by week
order by week asc
render line_chart with (y = win_rate, x_axis = "Week", smooth = true)

Note order by week asc — time charts read wrong when sorted by value, which is the default.

A heatmap needs two grouping dimensions and a value:

select games
from match_participants
group by champion, team_position
order by games desc
render heatmap with (value = games, series = team_position)
select games, win_rate, kda
from match_participants
where queue in (solo)
group by all
render kpi_card

GROUP BY all collapses everything to a single row, which is what a KPI card displays.

render bar_chart with (
y = win_rate,
title = "Ranked win rate",
subtitle = "Last 30 days",
y_axis = "Win rate",
theme = lol_dark,
palette = ranked,
labels = percent,
legend = none
)
  • themelol_dark, lol_light, minimal_dark, minimal_light.
  • paletteranked, categorical, team, gold, colorblind. Use colorblind for anything the whole server reads.
  • colors = (#rrggbb, …) — up to eight custom colors, contrast-corrected for the theme.
  • labelsauto, show, hide, value, percent.
  • sort — reorders the chart visually without changing the query’s rows.

Reports return at most 25 rows, and far fewer is usually better: a bar chart with 25 categories is unreadable in a Discord message. Set an explicit LIMIT of about 10 and let ORDER BY decide what matters.