CREATE CHART wraps a query and returns SVG. Ten chart types, one grammar. The chart definition lives in the same SQL file as the query that feeds it.
Comparisons, distributions, trends, and a few specialty charts
Bar and horizontal bar for category comparisons. Pie for share-of-whole.
Line and stacked area for ordered axes. Series come from a single SELECT, pivot with GROUP BY.
Histogram for shape, heatmap for two-axis density, scatter for bivariate cloud.
Radar for multi-KPI comparisons, candlestick for OHLC time series.
A SELECT inside, axes and titles outside
CREATE CHART BAR FROM (
SELECT category, ROUND(SUM(revenue), 2) AS rev
FROM retail.sales_daily
GROUP BY category
ORDER BY rev DESC
) X category Y rev
TITLE 'Revenue by Category'
VALUES ON;
Try the chart gallery demo in the GUI.