How to create charts using NodeJS? How to create charts using NodeJS? node.js node.js

How to create charts using NodeJS?


d3 is probably your best bet. It can generate nearly any type of chart imaginable.

You can generate the charts directly in the browser, or if you really need an image file, you can use the module in node and convert the output to an image.


You can use any charts library, basically. For example:

On your server template code, you might want to output the data using server variable. Example below using swig template engine, ExpressJS and Chartist library

<div class="ct-chart ct-perfect-fourth"></div><script>    new Chartist.Line('.ct-chart', {        labels: {{ chartLabel | raw }},         series : [{{ charts | raw}}]    }, {        axisY: {            onlyInteger: true        }    });</script>

Find out more about other charts library here


using highcharts

you have to install

npm install -g node-highcharts

refer the following link

https://github.com/davidpadbury/node-highcharts