Implement methods for legend.