Added legend click feature