title: Setting formatter callback using highcharts-convert.js
body: <p>I am using highcharts-convert.js to create PDF charts on the serverside. I want to set the dataLabel formatter for a column chart (<a href="http://api.highcharts.com/highcharts#plotOptions.column.dataLabels" rel="nofollow">http://api.highcharts.com/highcharts#plotOptions.column.dataLabels</a>). As this is a function, I can't write it in my output json file that is the input for highcharts-convert.js. So I assume I need to put it in my callback.js and call it like:</p>
  
  <p>highcharts-convert.js -infile infile.js -outfile outfile.pdf -width 1000 -callback callback.js</p>
  
  <p>But I can't set the formatter function in callback.js. I tried this:</p>
  
  <pre><code>function( chart ) {
      var labelFormatter = function(p) {
          if (this.y == 0) {
              return '';
          }
          else {
              return this.y
          }
      };
  
      chart.series.dataLabels.formatter = labelFormatter;
  }
  </code></pre>
  
  <p>But that gives me this error:</p>
  
  <pre><code>TypeError: 'undefined' is not an object (evaluating 'chart.series.dataLabels.formatter = labelFormatter')
  </code></pre>
  
  <p>I tried putting the formatter function outside the definition of the callback, but highcharts-convert.js won't accept that. How do I set a dataLabel formatter callback for highcharts-convert.js?</p>