How to suppress items with NULL value from HighCharts legend

Viewed 86

I've created a HighCharts donut graph. It will be filled with live data through a backend process. However, some of the data will have a 'name' but a NULL value for 'y'. I want to suppress these items in the legend. See the example fiddle here:

  events: {
      load: function() {
        this.series.forEach(function(s) {
          s.data.forEach(function(d) {
            if (d.y === null) {
              d.setVisible(false)
              }
            });
          })
        }
    },

http://jsfiddle.net/x2sw6b4e/

Here, the "Chrome" item has a NULL value.

I've managed to grey out the item in question but how to remove it altogether from the legend??

1 Answers
Related