You should know that I am new to Highcharts, so if my code or question seem weird, let me know.
Users can add data series to a chart.
When users click on the legend of a data series, that data series get's hidden from the chart and the legend get's grayed out. I want to change this behavior so that when users click on the legend of a data series, that data series should be completely removed from the chart, not only hidden.
I tried by writing the following code in highcharts-graph.js:
plotOptions: {
line: {
events: {
legendItemClick: function () {
this.remove(true);
}
}
}
}
This code removes the legend. But when a user adds another data series to the chart, the legend of the deactivated data series re-appears. So I believe that I need to modify the code to remove the data series instead of the legend.