Add IDs to profile editor legends

Fix issue #1715