Server-Side HighStock charts generation with NodeJS

后端 未结 3 1107
南笙
南笙 2021-02-06 09:56

I\'m using HighStock to generate some charts in browser. But now I want to store some of them at the server. So I know that HighCharts can be exported to the server but I\'d rat

相关标签:
3条回答
  • 2021-02-06 10:22

    I replaced node.js with phantomJs which did a good job, as described in Generating HTML Canvas image data server-side? (example is from jQplot, but works for highchart as well.)

    0 讨论(0)
  • 2021-02-06 10:34

    That can be fixed by raising the "forExport" flag in options object:

    options.chart.forExport = true;
    
    0 讨论(0)
  • 2021-02-06 10:34

    I tried to recreate your example and I get jQuery and Highcharts loaded with jsdom. It looks like Highcharts tries to call createElement with an html fragment:

    createElement('<div filled="f" stroked="f" style="position: absolute;left:0;top:0;width:10px;height:10px;"/>')
    

    This looks fishy. I'm not sure how it works in the browser - I can't call createElement with that in my browser either (Chromium).

    0 讨论(0)
提交回复
热议问题