title: Highcharts conditional data labels
body: <p>I'm creating a Highcharts line chart based upon some user input. The user can select 1 or more groupings and a date range and I create a series for each group. This works fine except for that when they select over 3 groups, the chart looks terrible because there are way too many data labels.</p>
  
  <p>I'd like to conditionally enable data labels only when where are less than 4 series on a chart. How can I do that? I'm trying like this but I can't seem to get it to work.</p>
  
  <pre><code>plotOptions: {
      line: {
          dataLabels: {
              enabled: function() {
                  return !!(chart.series.length &gt; 3);
              },
              color: '#000000',
              formatter: function() {
                  return Highcharts.numberFormat(this.y, 2);
              }
          }
      }
  }
  </code></pre>