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
AXIS BOTTOM
AXIS LEFT;
SELECT 'data' AS series, FROM_TIMESTAMP(time) AS x, value2 * 1000 AS y
FROM example_data
WHERE series = "measurement2";
The software currently is still in alpha stage but seems very useful already.