我正在尝试创建导出 pdf 的功能,在我的网页中渲染使用 Highcharts 创建的图表。我正在使用 Highcharts 的导出服务器来创建图表图像。我已按照以下链接中的步骤操作:
http://www.highcharts.com/docs/export-module/setting-up-the-server
我使用了 Node.js 导出服务器,网址如下:
https://github.com/highcharts/node-export-server
现在的问题是,我无法使用以下命令生成图像:
curl -H "Content-Type: application/json" -X POST -d '{"infile":{"title": {"text": "Steep Chart"}, "xAxis": {"categories": ["Jan", "Feb", "Mar"]}, "series": [{"data": [29.9, 71.5, 106.4]}]}}' 127.0.0.1:7801 -o mychart.png
在上述命令的结果中,我收到此错误:
curl: (7) Failed to connect to 127.0.0.1 port 7801: Connection refused
如有任何帮助,我们将不胜感激。
最佳答案
确保服务器已在运行。
highcharts-export-server -enableServer 1 -端口 7801
如果仍然失败,请确保您连接到正确的 IP 和端口。
关于javascript - Highcharts Node.js 导出服务器 : Connection error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42507472/