changed chart size, added legends for series, added function for time format
changed logic in order to avoid inserting same entries to db, added the few comments