add a new feature: when user click legend item, it will hide the line