Welcome aboard! We are happy you are here and wish you good net-raft!
// you must install npm install anychart-nodejs
// Node.js 6 or newer is needed
var fs = require('fs');
var anychartExport = require('anychart-nodejs');
var chart = "var chart = anychart.pie([10, 20, 7, 18, 30]); chart.bounds(0, 0, 800, 600); chart.container('container'); chart.draw()";
// generate PDF image and save it to a file
anychartExport.exportTo(chart, 'pdf').then(function(image) {
fs.writeFile('anychart.pdf', image, function(fsWriteError) {
if (fsWriteError) {
console.log(fsWriteError);
} else {
console.log('Complete');
}
});
}, function(generationError) {
console.log(generationError);
});
The most helpful NODEJS solutions