I have my export server up and running an am using to generate all charts on the server. One issue I am having is with datalabels. If I use format it works ok but I need formatter and it does not appear to be called. This is the relevant portion of my options:
dataLabels: {
enabled: true,
color: '#606060',
align: 'right',
//format:'{point.y:.0f}',
formatter:function(){
var val = this.y;
return val / 1000000 + 'M';
},
Since the value just gets displayed normally it appears that this function just does not get called. When I use these exact options on client it works fine. Is this not possible?
UPDATE: I have my own export server (highcharts-converter.js) as I am doing this all on the server with phantomjs. What I do is fetch data from another service and then build the infile like I would on the client. Problems I have run into are 1. doing JSON.stringify on infile gets rid of formatter functions. 2. If I make the function strings that does not work either because I have to call a webservice for the highcharts phantomjs. This means that the config automatically gets converted to JSON and when converter does a JSON.parse the functions remain strings. Not sure if I need to change highcharts-convert.js to somehow turn them back into functions but can't figure out how and am not sure how to debug that file since it is on a separate process (phantomjs child process). Have tried just about everything I can think of to fix this but no luck so far.
ALSO: Because the function is a string highcharts throws this error: TypeError: 'undefined' is not a function (evaluating 'axis.labelFormatter.call')