Adding fancy sql look back in

Accidentally left it out when doing the Mako templating stuff.

Also, small fix to line graph circle radius.