How to Make Charts to Visualize Your Data

PopSQL will automatically generate a chart based on the types of the columns returned in your query. The order of columns matters.

Line chart with one series

Timestamp and numeric

select
  date_trunc('week', created_at), -- timestamp
  count(1) -- numeric
from users
group by 1

Line chart with two series

Timestamp, text, numeric

select
  date_trunc('week', created_at), -- timestamp
  gender, -- text
  count(1) -- numeric
from users
group by 1,2

Bar/column chart

Text and numeric

select
  gender, -- text
  count(1) -- numeric
from users
group by 1

Text, text, numeric

select
  gender, -- text
  zip_code, -- text
  count(1) -- numeric
from users
group by 1,2

Scatter chart

Numeric, numeric

select
  x, -- numeric
  y -- numeric
from table

Feel free to reach out if you have any feedback about the chart feature! 📈