Skip to main content

Charts

Kvery can render your query results as a chart instead of a table. Charts are a fast way to spot trends and compare values, and they work on dashboards just as well as in the editor.

Available chart types​

ChartPageGood for
Vertical barBar chartsComparing values across categories
Horizontal barBar chartsCategory labels that are long
LineLine chartTrends over time
Mixed (bar + line)Mixed chartA total plus a rate on one chart
PiePie & doughnutShare of a whole
DoughnutPie & doughnutShare of a whole, with a centre

How a chart is built from your rows​

A chart needs two things from your result set:

  1. Labels — usually the first column (the category or the time axis).
  2. One or more series — the numeric columns that supply the values.

So a query like:

SELECT month, revenue, orders
FROM monthly_sales
ORDER BY month;

gives you month as the labels and revenue / orders as two series you can plot. Keep the label column first and your numeric columns after it, and the chart maps cleanly.

Switching to a chart​

Run the query, then choose Chart in the result area and pick the chart type. The chart is drawn from the rows already returned — switching views never re-runs the query.

Tips for good charts​

  • Aggregate in SQL. Chart a handful of grouped rows (GROUP BY), not thousands of raw rows — it is faster and far easier to read.
  • Order the labels with ORDER BY so a time axis reads left-to-right.
  • Hide helper columns you don't want plotted with ::hidden.
  • Name your columns with AS — the aliases become the series and axis labels.