Implemented the expand/collapse of classification legends.