Charts working from history stored in MySQL