dynamic legend