Created chart by querying data from database