【问题标题】:Highcharts export server setup Https serverHighcharts 导出服务器设置 Https 服务器
【发布时间】:2018-06-07 07:58:48
【问题描述】:

我正在尝试将我的 highchart 导出服务器设置为 http 服务器,以便我可以从代码发送请求并以 png、jpg、svg 或 pdf 格式获取所需的 highchart 输出。

我按照链接中的说明进行操作,但无法完成工作。

https://github.com/highcharts/node-export-server

我已经通过命令启动了节点服务器: highcharts-export-server --enableServer 1 --host localhost --port 3003--logLevel 4

但是当我通过邮递员应用程序发送请求时,我收到了这个错误:

Thu Jun 07 2018 15:01:10 GMT+0530 (India Standard Time) [error] socket error: { Error: Parse Error, bytesParsed: 0, code: 'HPE_INVALID_METHOD', Packet:<Buffer 16 03 01 02 00 01 00 01 fc 03 03 74 3d ad 38 d0 cb 27 88 ec 95 9b c7 4c 87 9a 09 ed 26 7e ad 74 5d 90 50 7c ba ec 7d 26 28 c1 b1 20 3d f3 80 05 92 54 .. > }

我的邮递员要求是: 网址:https://localhost:3003 内容类型:应用程序/json 正文:{ "xAxis": { "categories": [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ] }, "series": [ { "data": [1,3,2,4], "type": "line" }, { "data": [5,3,4,2], "type":"line" } ] }

我好像在请求中遗漏了一些东西。但同样的请求在 CURL 工具上运行良好,正在等待解决方案。

【问题讨论】:

  • 你应该把图表配置放在options 属性中,所以它应该看起来像这样:{ "options": { "xAxis": ... } }

标签: http pdf highcharts server export


【解决方案1】:

将图表配置放在“选项”节点中有效。 喜欢..

{ “类型”:“图像/png”, “选项”: { “xAxis”:{.......

感谢@morganfree 的评论。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-10-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-06-07
    • 1970-01-01
    相关资源
    最近更新 更多