add classes for legend
freeze legend when scrolling