I am trying below code for exporting chart data in excel having chart+data in trial version of FusionChart.
but acing below error
Error TS2307: Cannot find module 'path'.
Code I am using is below. I have tried all combination which you can see in commented tags below.
import * as path from 'path';
// const path = require('path');
// Require FusionExport
// const { ExportManager, ExportConfig } = require('../');
// Instantiate ExportManager
const exportManager = new ExportManager();
// Instantiate ExportConfig and add the required configurations
const exportConfig = new ExportConfig();
// __dirname = path.resolve(path.dirname(''));
// __dirname = path.resolve();
exportConfig.set('chartConfig', path.join( path.resolve(), 'resources'));
// provide the export config
exportManager.export(exportConfig, '.', true).then((exportedFiles) => {
exportedFiles.forEach(file => console.log(file));
}).catch((err) => {
console.log(err);
});