Recently, there is a need for background tuning statistics, the direct generation of pictures to spit to the front, originally thought relatively simple, the results in the middle or encountered a lot of problems:
Environment:
Windows:python 2.6+,visual Stdio Express Development Kit
Linux:gcc,python 2.6+
Node version: v0.10.35
Node component: [email protected] [email protected] [email protected]
Originally want to upgrade node to the latest version, in the installation of Jsdom error, can only be returned
[Email protected] Support node, higher version only supports IOJS
[Email protected] Install error on red Hat 4.4.7, [email protected] successfully installed
Request data:
Send HttpPost Request interface data:
The Content-length parameter in the header of the configuration request is equal to the length of the post data, which was not noticed causing the request to time out
Note that the accept-encoding parameter in the header is configured with gzip, and if Gzip is configured, it needs to be unpacked with zlib
Highchart Generating SVG:
The biggest problem is that the browser can generate SVG, after moving to node can not be generated, after Google, the parameters are constantly excluded, found in the Highchart configuration must add the following:
Chart: {
margin: [50, 30, 70, 50],//No, this doesn't show.
width:1000,
forexport:true//not add this will be an error
}
Hightchart version uses v2.3.3, background svg if there is a callout on the graph, it will be displayed abnormally, and the latest version will be improved. In this project, when using rsvg conversion png, the line width anomaly, suspect that the rsvg version is too low, in this requirement must use rsvg conversion, so you can only discard the latest version of the Highchart
Hightchart datetime type data, need to add 8 hours, to ensure that the display is normal, you need to adjust the YAxis x, y values, otherwise the y-coordinate display exception.
Summary:The module is open source in node, but the version compatibility of different modules is more troublesome. The complex presentation of the backend node's analog browser may have a variety of problems, the most troublesome is not debugging, difficult to find the reason.
For this project, consider using PHANTOMJS to solve
Generate SVG images with node