Time series plots from a sqlite database