Manoj,
You can hide legends as you hide the dataSeries, but once the legend is hidden on click, you wouldn’t be able to regain that legend.
Along with setting dataSeries visibility to false in toggleDataSeries method, set showInLegend property of that dataSeries to false.
if (typeof (e.dataSeries.visible) === "undefined" || e.dataSeries.visible) {
e.dataSeries.visible = false;
e.dataSeries.showInLegend = false;
} else {
e.dataSeries.visible = true;
}
__
Priyanka M S
Team CanvasJS