SELECT Date, Temp FROM ggsql:airquality
VISUALISE Date AS x, Temp AS y
DRAW line
SCALE x VIA date
LABEL
title => 'Daily Temperature',
x => 'Date',
y => 'Temperature (F)'Line Chart
basic
line
time-series
Time series visualization with proper date scaling
Line charts are ideal for showing trends over time. The SCALE x VIA date clause ensures proper date formatting on the axis.
Code
Explanation
SELECT ... FROM ggsql:airqualityqueries the built-in air quality datasetVISUALISE Date AS x, Temp AS ymaps the date column to x and temperature to yDRAW lineconnects data points with linesSCALE x VIA dateensures the x-axis is formatted as dates with appropriate tick marksLABELprovides descriptive titles for the chart and axes
Variations
Multiple Lines by Category
SELECT Date, Temp, Month FROM ggsql:airquality
VISUALISE Date AS x, Temp AS y, Month AS color
DRAW line
SCALE x VIA date
LABEL
title => 'Daily Temperature by Month',
x => 'Date',
y => 'Temperature (F)'