Fixes #2251: Legend labels are now ordered by node/edge attribute.