#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#
####Command line
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 HTTP server
Start PhantomJS as a server. You can use the same script as for command line usage. Start the server like this:
phantomjs highcharts-convert.js -host 127.0.0.1 -port 3003
You can change the host and port to your needs. The server listens only to a POST request. You can use the same parameters as for command line 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
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
利用springmvc框架编写的基于web 的远程控制设备系统,主要利用socket实现网络通信,属于点对点类型通信,前提需要知道你设备的ip地址以及端口号,根据实际情况修改这两个参数。注意该系统比较初级,并没有考虑多线程并发情况,请使用者根据情况合理使用,若因个人原因造成损失情况后果欺负。
资源推荐
资源详情
资源评论
收起资源包目录
springmvc+maven-基于web的远程控制设备系统 (3397个子文件)
UniCNS-UTF8-H.bcmap 52KB
UniCNS-UTF8-H.bcmap 52KB
UniCNS-UTF32-H.bcmap 51KB
UniCNS-UTF32-H.bcmap 51KB
UniCNS-UTF16-H.bcmap 49KB
UniCNS-UTF16-H.bcmap 49KB
UniCNS-UCS2-H.bcmap 47KB
UniCNS-UCS2-H.bcmap 47KB
UniGB-UTF8-H.bcmap 46KB
UniGB-UTF8-H.bcmap 46KB
UniGB-UTF32-H.bcmap 45KB
UniGB-UTF32-H.bcmap 45KB
UniGB-UTF16-H.bcmap 43KB
UniGB-UTF16-H.bcmap 43KB
UniGB-UCS2-H.bcmap 42KB
UniGB-UCS2-H.bcmap 42KB
UniJIS2004-UTF8-H.bcmap 41KB
UniJIS2004-UTF8-H.bcmap 41KB
UniJIS-UTF8-H.bcmap 41KB
UniJIS-UTF8-H.bcmap 41KB
Adobe-CNS1-UCS2.bcmap 40KB
Adobe-CNS1-UCS2.bcmap 40KB
Adobe-Japan1-UCS2.bcmap 40KB
Adobe-Japan1-UCS2.bcmap 40KB
UniJIS2004-UTF32-H.bcmap 40KB
UniJIS2004-UTF32-H.bcmap 40KB
UniJISX02132004-UTF32-H.bcmap 40KB
UniJISX02132004-UTF32-H.bcmap 40KB
UniJIS-UTF32-H.bcmap 40KB
UniJIS-UTF32-H.bcmap 40KB
UniJISX0213-UTF32-H.bcmap 40KB
UniJISX0213-UTF32-H.bcmap 40KB
UniJIS2004-UTF16-H.bcmap 39KB
UniJIS2004-UTF16-H.bcmap 39KB
UniJIS-UTF16-H.bcmap 39KB
UniJIS-UTF16-H.bcmap 39KB
Adobe-GB1-UCS2.bcmap 33KB
Adobe-GB1-UCS2.bcmap 33KB
UniKS-UTF8-H.bcmap 27KB
UniKS-UTF8-H.bcmap 27KB
UniKS-UTF32-H.bcmap 26KB
UniKS-UTF32-H.bcmap 26KB
UniKS-UTF16-H.bcmap 26KB
UniKS-UTF16-H.bcmap 26KB
UniKS-UCS2-H.bcmap 25KB
UniKS-UCS2-H.bcmap 25KB
UniJIS-UCS2-H.bcmap 25KB
UniJIS-UCS2-H.bcmap 25KB
Adobe-Korea1-UCS2.bcmap 23KB
Adobe-Korea1-UCS2.bcmap 23KB
GBK2K-H.bcmap 19KB
GBK2K-H.bcmap 19KB
KSC-Johab-H.bcmap 16KB
KSC-Johab-H.bcmap 16KB
GBK-EUC-H.bcmap 14KB
GBK-EUC-H.bcmap 14KB
GBKp-EUC-H.bcmap 14KB
GBKp-EUC-H.bcmap 14KB
GBTpc-EUC-H.bcmap 7KB
GBTpc-EUC-H.bcmap 7KB
GBT-EUC-H.bcmap 7KB
GBT-EUC-H.bcmap 7KB
GBT-H.bcmap 7KB
GBT-H.bcmap 7KB
HKscs-B5-H.bcmap 4KB
HKscs-B5-H.bcmap 4KB
ETHK-B5-H.bcmap 4KB
ETHK-B5-H.bcmap 4KB
KSCms-UHC-HW-H.bcmap 3KB
KSCms-UHC-HW-H.bcmap 3KB
KSCms-UHC-H.bcmap 3KB
KSCms-UHC-H.bcmap 3KB
NWP-H.bcmap 3KB
NWP-H.bcmap 3KB
HKdla-B5-H.bcmap 3KB
HKdla-B5-H.bcmap 3KB
78ms-RKSJ-H.bcmap 3KB
78ms-RKSJ-H.bcmap 3KB
Ext-RKSJ-H.bcmap 2KB
Ext-RKSJ-H.bcmap 2KB
Ext-H.bcmap 2KB
Ext-H.bcmap 2KB
Add-H.bcmap 2KB
Add-H.bcmap 2KB
HKdlb-B5-H.bcmap 2KB
HKdlb-B5-H.bcmap 2KB
Add-RKSJ-H.bcmap 2KB
Add-RKSJ-H.bcmap 2KB
78-EUC-H.bcmap 2KB
78-EUC-H.bcmap 2KB
78-RKSJ-H.bcmap 2KB
78-RKSJ-H.bcmap 2KB
78-H.bcmap 2KB
78-H.bcmap 2KB
HKgccs-B5-H.bcmap 2KB
HKgccs-B5-H.bcmap 2KB
HKm471-B5-H.bcmap 2KB
HKm471-B5-H.bcmap 2KB
KSCpc-EUC-H.bcmap 2KB
KSCpc-EUC-H.bcmap 2KB
共 3397 条
- 1
- 2
- 3
- 4
- 5
- 6
- 34
资源评论
撸铁Coder
- 粉丝: 5
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功