Now it gets even easier. I just published a simple node module, chartjs-node which takes out all the guess work and lets you draw Chartjs charts with just a couple lines of code.
First you’ll need to npm install chart.js since it’s a peer dependency:
npm install chart.js --save
Install Cairo for your system then just require up the module and create a new ChartjsNode object by defining the chart dimensions:
Now just use the
drawChart function to draw the chart by passing a Chart.js configuration object. Every API returns a
And that’s pretty much it. Easy charting in Node.js.