Reading Time: < 1 minute

This is a node.js application/service that converts Highcharts.JS charts to static image files. It supports PNG, JPEG, SVG, and PDF output; and the input can be either SVG, or JSON-formatted chart options.
The application can be used either as a CLI (Command Line Interface), as an HTTP server, or as a node.js module.

First, make sure you have node.js installed. If you dont have node.js installed, kindly go this link

Hope node.js is installed,now we will install the export server

git clone
cd node-export-server/

Now install the dependent packages

yum install fontconfig freetype freetype-devel fontconfig-devel libstdc++ tar gzip unzip zip bzip2

Create log folder for highchartExport

mkdir -p /home/techrunnr/highchartsExport/logs

Now clean the npm and install phantomjs-prebuilt package

npm cache clean -f

npm install -g phantomjs-prebuilt

cd ..
npm install

[techrunnr@node-server ~]$ cd node-export-server/
[techrunnr@node-server node-export-server]$ ls
bin  build.js  lib  LICENSE  msg  mychart.png  node_modules  package.json  package-lock.json  phantom  testcharts  tests
[techrunnr@node-server node-export-server]$ npm install

> highcharts-export-server@2.0.25 preinstall /home/techrunnr/node-export-server
> node ./

Preinstall: no tasks to be done, skipping

> highcharts-export-server@2.0.25 install /home/techrunnr/node-export-server
> node ./build.js

Highcharts Export Server

In order to use this application, Highcharts needs to be downloaded and 
embedded. A license is required to use Highcharts if you're a 
for-profit, commercial, outfit. 

The license can be viewed here:


Are you behind a proxy?

Are you behind a company firewall?
Try running "npm config set strict-ssl=false" before installing

Agree to the license terms? y/n:  (no) y
Select your Highcharts version (e.g. 4.2.2)::  (latest) 7.0.1
Include Maps? (requires Maps license):  (no) y
Include Gantt? (requires Gantt license, and >V6.2):  (no) n
Enable styled mode? (requires Highcharts/Highstock 5+ license):  (no) n
Include moment.js for date/time handling?:  (no) y
Which CDN would you like to use?:  ( 
Enable wordcloud support? y/n:  (no) y
Enable annotations support? y/n:  (no) y
Including maps support
Including moment.js support
Pulling Highcharts from CDN (7.0.1)..
   organization.js is not available for v7.0.1, skipped..
   funnel3d.js is not available for v7.0.1, skipped..
   pyramid3d.js is not available for v7.0.1, skipped..
   dependency-wheel.js is not available for v7.0.1, skipped..
Creating export template export..
All done! Happy charting!
For documentation, see

> highcharts-export-server@2.0.25 postinstall /home/techrunnr/node-export-server
> node ./

[techrunnr@node-server node-export-server]$ 

[root@node-server node-export-server]# npm link
npm WARN lifecycle highcharts-export-server@2.0.25~preinstall: cannot run in wd %s %s (wd=%s) highcharts-export-server@2.0.25 node ./ /home/techrunnr/node-export-server
npm WARN lifecycle highcharts-export-server@2.0.25~install: cannot run in wd %s %s (wd=%s) highcharts-export-server@2.0.25 node ./build.js /home/techrunnr/node-export-server
npm WARN lifecycle highcharts-export-server@2.0.25~postinstall: cannot run in wd %s %s (wd=%s) highcharts-export-server@2.0.25 node ./ /home/techrunnr/node-export-server
/usr/bin/highcharts-export-server -> /usr/lib/node_modules/highcharts-export-server/bin/cli.js
/usr/lib/node_modules/highcharts-export-server -> /home/techrunnr/node-export-server
[root@node-server node-export-server]#

Lets create to start script for the highchart export server

cd scripts/
/usr/lib/node_modules/highcharts-export-server/bin/cli.js --enableServer 1 --tmpDir /home/techrunnr/highchartsExport --logDest /home/techrunnr/highchartsExport/logs --logLevel 4 &

Stop script for highchart export server

pkill -9 -f node

Give execute permission for both the scripts.

chmod 755
chmod 755

We can test highchart export through one curl command

[root@node-server ~]# curl -H "Content-Type: application/json" -X POST -d '{"infile":{"title": {"text": "Steep Chart"}, "xAxis": {"categories": ["Jan", "Feb", "Mar"]}, "series": [{"data": [29.9, 71.5, 106.4]}]}}' -o mychart.png
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 14571  100 14435  100   136  14435    136  0:00:01 --:--:--  0:00:01 54984

Now we have setted up high Chart Exporter.

© 2019, Techrunnr. All rights reserved.

Questions Answered
Articles Written
Overall Points


Leave a Reply