Add scrolling behavior to legends