Updated graph logic in profile page