import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
// Import angular-fusioncharts
import { FusionChartsModule } from 'angular-fusioncharts';
// Import FusionCharts library
import * as FusionCharts from 'fusioncharts';
// Load FusionCharts Individual Charts
import * as Charts from 'fusioncharts/fusioncharts.charts';
// Add other dependecies like Charts, PowerCharts, Widgets, Maps
// import FusionTheme from 'fusioncharts/themes/fusioncharts.theme.fusion';
// import Maps from 'fusioncharts/fusioncharts.maps';
// import World from 'fusioncharts/maps/fusioncharts.world';
// Use fcRoot function to inject FusionCharts library, and the modules
// you want to use
//FusionChartsModule.fcRoot(FusionCharts, [Comma separated charts and features])
FusionChartsModule.fcRoot(FusionCharts, Charts)
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
FusionChartsModule // Include in imports
],
bootstrap: [AppComponent]
})
export class AppModule { }
2条答案
按热度按时间cpjpxq1n1#
尝试将
ng-fusioncharts
作为体面的内容包括在内,mgdq6dx12#
安装Angular-FusionCharts在终端运行以下命令:
如果尚未安装FusionCharts,请安装:
导入Angular FusionCharts模块
在根Angular @NgModule中,从angular-fusioncharts导入FusionChartsModule,并将FusionChartsModule添加为依赖项。
参考文件-https://fusioncharts.github.io/angular-fusioncharts/#/ex1