Add support for hiding when clicking colored square

This pull request adds support for showing/hiding the series when clicking on the corresponding colored square in the legend.