Different chart types need different SQL result shapes. A query shape is the set of columns and rows a chart expects.
Number charts
Return one row with one or more numeric values.
select count(*) as active_users from users where is_active = 1select count(*) as active_users from users where is_active = 1Bar and line charts
Return a category or date column and one or more numeric values.
select date(created_at) as day, count(*) as orders
from orders
group by 1
order by 1select date(created_at) as day, count(*) as orders
from orders
group by 1
order by 1Series-based charts
Return a category, series, and value.
select month, plan, count(*) as accounts
from account_metrics
group by 1, 2select month, plan, count(*) as accounts
from account_metrics
group by 1, 2Radar charts
Return a radar dimension and one or more numeric values. For multiple radar polygons, return dimension, series, and value columns.
select dimension, team_name as series, score as value
from team_scorecard
order by display_order, team_nameselect dimension, team_name as series, score as value
from team_scorecard
order by display_order, team_nameTable and download charts
Return the rows and columns viewers need to inspect or export.
Map charts
Return latitude and longitude fields, plus useful labels or values.