Unable to parse JSON string with highcharts exporting server with the windows phantomjs version

时间秒杀一切 提交于 2019-12-12 14:14:25

问题


What i did:

  • Download the latest phantomjs (1.9.2, windows)
  • Download the latest sources of highcharts-convert.js from github (note: download the whole directory)
  • Start phantomjs with convert script in server mode:

bin\phantomjs.exe --debug=yes js\highcharts-convert.js -host 127.0.0.1 -port 3003

  • Use CURL to send example json to phantomjs server:

curl -H "Content-Type: application/json" -X POST -d '{"infile":"{xAxis: {categories: [\"Jan\", \"Feb\", \"Mar\"]},series: [{data: [29.9, 71.5, 106.4]}]}"}' 127.0.0.1:3003

What I got:

Failed rendering: SyntaxError: Unable to parse JSON string

Note: This is running fine on the command line:

bin\phantomjs js\highcharts-convert.js -infile options.json -outfile chart.svg

来源:https://stackoverflow.com/questions/18919824/unable-to-parse-json-string-with-highcharts-exporting-server-with-the-windows-ph

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!