FnordMetric is an interesting new software package that allows you to create good-looking charts (in SVG format) directly from SQL using a query language called ChartSQL.
The are quite a few examples available here. A typical ChartSQL query for a timeline series chart for instance looks like this:
DRAW LINECHART WITH
SELECT 'data' AS series, FROM_TIMESTAMP(time) AS x, value2 * 1000 AS y
WHERE series = "measurement2";
The software currently is still in alpha stage but seems very useful already.