score:1

you can use the load event to examine series in a loop and hide the ones without any data:

var chart = highcharts.chart('container', {

  chart: {
    events: {
      load: function() {
        this.series.foreach(function(s) {
          s.update({
            showinlegend: s.points.length
          });
        });
      }
    }
  },

  series: [{
    data: [1, 2]
  }, {
    data: [3, 4, 2]
  }, {
    data: [] // no data
  }]
});

live demo: http://jsfiddle.net/kkulig/355u0kaw/


api references:


Related Query

More Query from same tag