Size, colors and titles
The options of \chart set the title, the subtitle and the size of a chart. The names of the columns of the query name the series.
The recording writes each chart to an SVG file with file=, because the player of the recordings draws no images. In a terminal that draws images, the same \chart without file= draws the chart in place. The examples use the tables of the gallery.
A title and a subtitle
Section titled “A title and a subtitle”title sets the title above the chart, and subtitle sets the line under it. Put a value that holds a space in single quotes:
select month, coffee as "Coffee", tea as "Tea"from sales order by month_no\chart title='Cups sold' subtitle='January to June 2026'The names of the series
Section titled “The names of the series”The legend shows the name of each column. To change a name, rename the column in the query with as. The query above shows Coffee and Tea in place of coffee and tea. Put a name in double quotes, because some databases, such as PostgreSQL, change a name with no quotes to lower case.
The size
Section titled “The size”size sets the width and the height of the chart in pixels, as WIDTHxHEIGHT. The default is 800x600. The title, the axes and the legend are inside that size.
\chart title='Cups sold' size=640x320With an empty query buffer, \chart draws the last query again, so this line draws the query of the first chart in a new size.
The colors
Section titled “The colors”usql chooses the color of each series. No option changes the colors of the series.
The option bg sets the color of the background, such as bg=black or bg='#f0f0f0'. The default is white.