Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate charts without HTML / Browser

I have a node.js application that accesses data of a MySQL database and I want to generate charts from that data dynamically, to pipe it as image (PNG/JPG) through a HTTP server to the user. I've search for a little while now, but I was unable to find a library to do this without the HTML/canvas approach. Since I want to let the server do the rendering to use the graph in emails or also dynamically rendered PDF files, this isn't an option here.

What could be the approach here (with or without a library) ?

Edit to provide proof of own work: I found https://plot.ly, which is in terms of usage and result really close to fulfil my needs, but requires an internet connection, since it calls a remote API.

like image 574
XQDev Avatar asked Jan 18 '16 12:01

XQDev


People also ask

Can Chart js be used offline?

Is it possible to use chart. js for a desktop/mobile application using html that connects through an esp8266 access point or does it need a wifi connection? @marionboynton, CanvasJS is a standalone library that can work offline without any internet connection.

Is Chart JS free to use?

Chart.js is a free, open-source JavaScript library for data visualization, which supports eight chart types: bar, line, area, pie (doughnut), bubble, radar, polar, and scatter.

Is ApexCharts free?

Free & Open Source ApexCharts.js is an open source project licensed under MIT and is free to use in commercial applications.


2 Answers

You could also try asking this in the Software Recs Stack Overflow. But one option that seems like it could fit your needs is ZingChart.

They have a phantomJS build for rendering static versions of charts. In addition, licensed users can access a Node.js build for server side charting.

Full disclosure, I'm on the ZingChart team so please let me know if I can help you review all your options.

like image 147
Merrily Avatar answered Oct 27 '22 01:10

Merrily


There is a node wrapper for the chart library chartist. You could use this library to generate a SVG, and a svg2png lib to convert to PNG.

like image 44
hansmaad Avatar answered Oct 27 '22 01:10

hansmaad