chart now reads data from the database