score:5

Accepted answer

i have added the below code to detect the legend item clicked.

function(chart) {
        $(chart.series[0].data).each(function(i, e) {
            e.legenditem.on('click', function(event) {
                var legenditem=e.name;

                event.stoppropagation();

                $(chart.series).each(function(j,f){
                       $(this.data).each(function(k,z){
                           if(z.name==legenditem)
                           {
                               if(z.visible)
                               {
                                   z.setvisible(false);
                               }
                               else
                               {
                                   z.setvisible(true);
                               }
                           }
                       });
                });

            });
        });
    }

here is the jsfiddle


Related Query

More Query from same tag