score:1

Accepted answer

plotoptions will be as

 plotoptions: {
  column: {
    stacking: ''
  },
  series: {
    pointpadding: 0.2,
    borderwidth: 0,
    datalabels: {
      //enabled: false
    },
    events: {
      legenditemclick: function(event) {
        console.log(this.options.name);
        var donut = $('#pie_chart').highcharts(),
          series_arr = donut.series[0].data;
        //console.log(series_arr);
        for (series in series_arr) {
          if (this.options.name === series_arr[series].name) {
            if (this.visible) {
              series_arr[series].setvisible(false);

            } else {
              series_arr[series].setvisible(true)

            }

          }
        }
      }
    }
  }
},

forked fiddle

error is

this.options.name === series.name

and it will be

this.options.name === series_arr[series].name

and use setvisible() to toggle


Related Query

More Query from same tag