Thank you very much in advance.
I want to configure phantomjs Highcharts export server. It should accept json options as input and output files of jpeg images.
That's what I'm doing:
Then I tried to use the client code on this site: http://export.highcharts.com/demo to send the request. I changed the form url from this:
<form id="exportForm" action="./" method="POST">
:
<form id="exportForm" action="http://0.0.0.0:3001" method="POST">
and clicked "Highcharts Configuration Object (JSON)". All I get is this message:
Rendering failed: SyntaxError: unable to parse JSON string
Since the same request can be correctly processed on the Highcharts server, the error should be in the js code of the Highcharts server that I use. I also tried the following command:
phantomjs highcharts-convert.js -infile options.js \ -outfile chart.png -scale 2.5 -width 300
Using this code in options.js :
{ infile: { xAxis: { categories:['Jan','Feb','Mar','Apr', 'May','Jun','Jul','Aug', 'Sep','Oct','Nov','Dec'] }, series:[ { data:[29.9,71.5,106.4,129.2, 144.0,176.0,135.6,148.5, 216.4,194.1,95.6,54.4] }] }, callback: function(chart){ chart.renderer .arc(200,150,100,50,-Math.PI,0) .attr({fill:'#FCFFC5',stroke:'black','stroke-width':1}) .add(); }, constr: "Chart", outfile: "//tmp//chart.png" }
And it successfully generates png.
I think Highchart did not work much in exporting functions, and I found some typo in the highcharts-convert.js file. Can someone help me with this? Many thanks.