angularjs 'angular-fusioncharts'不在npm注册表中

pxyaymoc  于 2023-10-15  发布在  Angular
关注(0)|答案(2)|浏览(130)

当我尝试在package.json中包含angular-fusioncharts时,我得到以下错误:
'angular-fusioncharts'不在npm注册表中。

cpjpxq1n

cpjpxq1n1#

尝试将ng-fusioncharts作为体面的内容包括在内,

angular.module("myApp", ["ng-fusioncharts"])
mgdq6dx1

mgdq6dx12#

安装Angular-FusionCharts在终端运行以下命令:

$ npm install angular-fusioncharts --save

如果尚未安装FusionCharts,请安装:

$ npm install fusioncharts --save

导入Angular FusionCharts模块
在根Angular @NgModule中,从angular-fusioncharts导入FusionChartsModule,并将FusionChartsModule添加为依赖项。

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 { }

参考文件-https://fusioncharts.github.io/angular-fusioncharts/#/ex1

相关问题