added ability to show legend in user specified view