updated auto legend feature