add legend to attribute editing