allow group name to be set based on associated accessor
improve legend test case