add interactivity to legend