我在我的Ionic2(v2.0.0(项目中使用了angular2-highcharts(v0.4.1(组件。
当我运行我的页面时,我有一个来自高图表的错误 7。
我尝试在我的角度组件上添加此代码,但没有成功......
import * as Highcharts from 'highcharts';
import * as HighchartsMore from 'highcharts/highcharts-more.js';
HighchartsMore(Highcharts);
而这...
declare var require: any;
const Highcharts = require('../../../node_modules/highcharts/highstock.src');
const HighchartsMore = require('../../../node_modules/highcharts/highcharts-more.js');
HighchartsMore(Highcharts);
有人向此模块添加了一些组件吗? 或者知道一些库在 Angular2 上使用高图表?
离子信息:
Cordova CLI: 6.5.0
Ionic Framework Version: 2.0.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.0.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v4.1.0
Xcode version: Not installed
我让它像这样工作(我使用来自 npm 的香草高图,而不是 angular2-highcharts,呵呵!
import * as HighchartsMore from 'highcharts/highcharts-more';
import Highcharts from 'highcharts';
在构造函数中:
HighchartsMore(Highcharts);
希望这有帮助!