问题描述
我正在将Highcharts和React用于一个项目,并且需要为生成的SVG支持服务器端渲染.有人可以建议一种方法来使我得到一个静态渲染的页面,其图像为png/jpg吗?用于查看渲染内容的浏览器不支持svg.
I am using Highcharts and React for a project and need to support server side rendering for the SVG generated. Could someone suggest a way of doing it so that I get a static rendered page with images as png/jpg? The browser to be used for viewing rendered content does not support svg.
谢谢.
推荐答案
找到了解决方案.Highcharts可以为我一直在寻找的现成解决方案.它是一个节点/表达服务器,用于使用PhantomJS从highcharts配置json获取png响应. https://www.highcharts.com/docs/export-模块/设置服务器
Found the solution. Highcharts has a ready solution for doing just what I was looking for. Its a node/express server for getting png response from the highcharts configuration json using PhantomJS. https://www.highcharts.com/docs/export-module/setting-up-the-server
这篇关于有没有一种方法可以使用React来执行SVG图形的服务器端渲染?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!