How to create charts using NodeJS?

后端 未结 3 1415
名媛妹妹
名媛妹妹 2020-12-28 13:26

Is it possible to create charts, e.g. bars and pies with custom icons using NodeJS?

相关标签:
3条回答
  • 2020-12-28 14:16

    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.

    0 讨论(0)
  • 2020-12-28 14:16

    using highcharts

    you have to install

    npm install -g node-highcharts
    

    refer the following link

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

    0 讨论(0)
  • 2020-12-28 14:20

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

    • Google Chart API
    • Chartjs
    • Chartist

    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

    0 讨论(0)
提交回复
热议问题