Hello,
I have a working chart that when clicking on a serie in the legend it switches to show only present and previous year, but when clicking back, the labels of the previous one are still present. (try clicking on 2020 and after click on 2021)
Here is a working jsfiddle: https://jsfiddle.net/eugenursu/zp9a82or/
In a second note, does the Highcharts.addEvent work for clicking on the legend? I can't seem to make it work. Code at the end of the jsfiddle.
Best regards!