#The Highcharts image convert script#
The file highcharts-convert.js is a [PhantomJS](http://phantomjs.org/) script to convert SVG or Highcharts JSON options objects to chart images. It is ideal for batch processing Highcharts configurations for attaching to emails or reports. It is also used in the featured (Java based) export server. An online demo with a GUI can be viewed at [export.highcharts.com/demo](http://export.highcharts.com/demo).
#Example usage#
for commandline use.
phantomjs highcharts-convert.js -infile options1.json -outfile chart1.png -scale 2.5 -width 300 -constr Chart -callback callback.js
Run Phantomjs as Http-server.
phantomjs highcharts-convert.js -host 127.0.0.1 -port 3003
#Description of command line parameters#
**-infile:** The file to convert, assumes it's either a JSON file, the script checks for the input file to have the extension '.json', or otherwise it assumes it to be an svg file.
**-outfile:** The file to output. Must be a filename with the extension .jpg, .png .pdf or .svg.
**-scale:** To set the zoomFactor of the page rendered by PhantomJs. For example, if the _chart.width_ option in the chart configuration is set to 600 and the scale is set to 2, the output raster image will have a pixel width of 1200. So this is a convenient way of increasing the resolution without decreasing the font size and line widths in the chart. This is ignored if the _-width_ parameter is set.
**-width:** Set the exact pixel width of the exported image or pdf. This overrides the _-scale_ parameter.
**-constr:** The constructor name. Can be one of _Chart_ or _StockChart_. This depends on whether you want to generate Highstock or basic Highcharts.
**-callback:** Filename of the _callback_. The _callback_ is a function which will be called in the constructor of Highcharts to be executed on chart load. All code of the callback must be enclosed by a function. See this example of contents of the callback file:
function(chart) {
chart.renderer.arc(200, 150, 100, 50, -Math.PI, 0).attr({
fill : '#FCFFC5',
stroke : 'black',
'stroke-width' : 1
}).add();
}
**-host** The hostname Phantomjs is listening to for POST-requests. If this parameter is specified, phantomjs startsup as Http-server.
**-port** The portnumber Phantomjs is listening to for POST-requests.
#Running the script as Httpserver
Start the Phantomjs as a server. You can use the same script as for commandline usage. Start the server like this.
phantomjs highcharts-convert.js -host 127.0.0.1 -port 3003
You can ofcourse change the host and port to your needs. The server listens only to a POST-request. You can use the the same parameters as for commandline usage, but wrap them in a JSON structure.
Example of an POST request
"{"infile":"{xAxis: {categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']},series: [{data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]}]};","callback":"function(chart) {chart.renderer.arc(200, 150, 100, 50, -Math.PI, 0).attr({fill : '#FCFFC5',stroke : 'black','stroke-width' : 1}).add();}","constr":"Chart"}"
#Installation of Phantomjs#
See http://phantomjs.org/download.html
没有合适的资源?快使用搜索试试~ 我知道了~
html 曲线图js源码
共290个文件
js:92个
htm:58个
tmp:28个
5星 · 超过95%的资源 需积分: 15 12 下载量 14 浏览量
2017-09-14
11:08:03
上传
评论
收藏 13.03MB ZIP 举报
温馨提示
html 曲线图js源码,其中包含html前端代码及js后端代码,曲线图种类丰富,可以满足各个行业的曲线图的需求,应用简单
资源推荐
资源详情
资源评论
收起资源包目录
html 曲线图js源码 (290个子文件)
ExportController.class 12KB
ExportController.class 12KB
ServerObjectFactory.class 9KB
Server.class 6KB
SVGConverter.class 6KB
AbstractPool.class 5KB
BlockingQueuePool.class 3KB
AbstractPool$1.class 3KB
MimeType.class 2KB
TempDir.class 2KB
Server$1.class 2KB
CorsFilter.class 2KB
CorsFilter.class 2KB
ServerObjectFactory$PortStatus.class 1KB
ServerState.class 1KB
TimeOut.class 1KB
SVGConverterException.class 722B
PoolException.class 688B
ObjectPool.class 589B
ObjectFactory.class 427B
codemirror.css 5KB
codemirror.css 5KB
demo.css 2KB
demo.css 2KB
dialog.css 449B
dialog.css 449B
simple-hint.css 368B
simple-hint.css 368B
index.htm 18KB
index.htm 13KB
index.htm 12KB
index.htm 10KB
index.htm 7KB
index.htm 5KB
index.htm 5KB
index.htm 5KB
index.htm 5KB
index.htm 5KB
index.htm 5KB
index.htm 4KB
index.htm 4KB
index.htm 3KB
index.htm 3KB
index.htm 3KB
index.htm 3KB
index.htm 3KB
index.htm 3KB
index.htm 3KB
index.htm 3KB
index.htm 3KB
index.htm 3KB
index.htm 3KB
index.htm 3KB
index.htm 2KB
index.htm 2KB
index.htm 2KB
index.htm 2KB
index.htm 2KB
index.htm 2KB
index.htm 2KB
index.htm 2KB
index.htm 2KB
index.htm 2KB
index.htm 2KB
index.htm 2KB
index.htm 2KB
index.htm 2KB
index.htm 2KB
index.htm 2KB
index.htm 2KB
index.htm 2KB
index.htm 2KB
index.htm 2KB
index.htm 2KB
index.htm 2KB
index.htm 2KB
index.htm 2KB
index.htm 2KB
index.htm 2KB
index.htm 1KB
index.htm 1KB
index.htm 1KB
index.htm 1KB
index.htm 1KB
index.htm 1KB
index.htm 1KB
index.html 3KB
index.html 3KB
index.html 2KB
index.html 2KB
typescript.html 1KB
typescript.html 1KB
spring-core-3.2.0.RELEASE.jar 843KB
spring-context-3.2.0.RELEASE.jar 834KB
spring-webmvc-3.2.0.RELEASE.jar 621KB
spring-web-3.2.0.RELEASE.jar 610KB
spring-beans-3.2.0.RELEASE.jar 591KB
standard-1.1.2.jar 384KB
log4j-1.2.14.jar 359KB
spring-aop-3.2.0.RELEASE.jar 327KB
共 290 条
- 1
- 2
- 3
资源评论
- 康仔20122019-10-25比相关书籍介绍的详细,顶一个.
dsc199202
- 粉丝: 1
- 资源: 11
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- tensorflow-2.8.2-cp310-cp310-win-amd64.whl
- tensorflow-2.8.1-cp39-cp39-win-amd64.whl
- 基于Cadence-All...PCB信号完整性分析与设计-巫玲.pdf
- tensorflow-gpu-2.8.2-cp310-cp310-win-amd64.whl
- 基于Springboot的大学生租房系统(有报告) Javaee项目,springboot项目
- 视频打赏观看视频系统源码.zip
- 基于Cadence-Sigrity板级的电热协同仿真-封云鹏.pdf
- 基于Springboot的会员制医疗预约服务管理信息系统(有报告) Javaee项目,springboot项目
- MySQL忘记root密码解决方案
- thinkphp云赏修复版视频打赏V8.5网站源码.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功