我试图将3d highcharts模块集成到我的应用程序中,其他聊天工作正常,但是当我添加3d模块时,我在这行上遇到编译错误:
import Highcharts3d from 'highcharts/highcharts-3d';
并且编译器说:
无法找到模块Highcharts3d
这是我的系统js comfig:
我只是按照此页面配置: https://www.npmjs.com/package/angular2-highcharts
var map = {
'app': 'app', // 'dist',
'rxjs': 'https://npmcdn.com/rxjs@5.0.0-beta.6',
'angular2-in-memory-web-api': 'https://npmcdn.com/angular2-in-memory-web-api', // get latest,
'angular2-highcharts': 'https://cdn.rawgit.com/gevgeny/angular2-highcharts/0.1.0/dist',
'highcharts/highstock.src': 'https://cdn.rawgit.com/highcharts/highcharts-dist/v4.2.1/highstock.js',
'highcharts/highcharts-3d': 'https://cdn.rawgit.com/highcharts/highcharts-dist/v4.2.1/highcharts-3d.src.js',
};
关于我在做什么的任何想法都是正确的?
答案 0 :(得分:1)
对该代码进行了检查,您应该使用以下代码行:
import { CHART_DIRECTIVES, Highcharts } from 'angular2-highcharts';
System.import('highcharts/highcharts-3d').then((Highcharts3d) => {
Highcharts3d(Highcharts);
});
祝你好运