fixed legend position to avoid colliding with graph