Skip to content

Bar Chart ​

You can present your data as a Bar Chart

Basic use ​

DateDistance
2025-05-0140.4
2025-05-0234.43
2025-05-0343.53
2025-05-0450.23
sqlseal
TABLE t = table(0)
CHART {
	xAxis: {
		type: 'category'
	},
	yAxis: {},
	series: [
		{ type: 'bar' }
	]
}
SELECT * FROM t

bar chart example

Multiple series ​

You can show multiple series on the same chart. To do that you need to specify multiple series and define which column name corresponds to the y axis (values). We can also include interactive legend:

DateDistance
2025-05-0140.4
2025-05-0234.43
2025-05-0343.53
2025-05-0450.23
sqlseal
TABLE t = table(0)
CHART {
	xAxis: {
		type: 'category'
	},
	yAxis: {},
	legend: { show: true },
	series: [
		{
			type: 'bar', 
			encode: { y: 'walked' },
			name: 'Walked'
		},
		{
			type: 'bar', 
			encode: { y: 'biked' },
			name: 'Biked'
		}
	]
}
SELECT * FROM t

bar chart multi