Update Legend when graph is updated