sharavan

FusionExport is not working in angular 5/6

Recommended Posts

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);
});

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now