D3 legend click event