如何在 Angular 中实现 Fusioncharts 地图?
How to implement Fusioncharts Maps in Angular?
Fusioncharts 地图遇到此错误
fusioncharts.js:19 GET http://localhost:8100/fusioncharts.usa.js net::ERR_ABORTED 404 (Not Found)
HTML
<fusioncharts width="100%" height="200" type="usa" dataFormat="json"
[dataSource]="geographicDistributionDataSource">
</fusioncharts>
module.ts
import { FusionChartsModule } from 'angular-fusioncharts';
// Import FusionCharts library and chart modules
import * as FusionCharts from "fusioncharts";
import * as FusionMaps from "fusioncharts/fusioncharts.maps";
import * as Charts from "fusioncharts/fusioncharts.charts";
import * as Widgets from "fusioncharts/fusioncharts.widgets";
import * as Gantt from "fusioncharts/fusioncharts.gantt";
import * as Powercharts from "fusioncharts/fusioncharts.powercharts";
import * as Msstackedcolumn2dsplinedy from "fusioncharts/fusioncharts.msstackedcolumn2dsplinedy";
import * as FusionTheme from "fusioncharts/themes/fusioncharts.theme.fusion";
import * as MultiCharts from "fusioncharts/fusioncharts.zoomline";
import { ModalModule } from './component/modal/modal.module';
// Pass the fusioncharts library and chart modules
FusionChartsModule.fcRoot(FusionCharts, FusionMaps, FusionTheme, Charts, Gantt, Widgets,
Powercharts, Msstackedcolumn2dsplinedy, MultiCharts);
@NgModule({
declarations: [],
imports: [
FusionChartsModule
],
exports: [
FusionChartsModule
]
})
您需要在 module.ts
中导入 USA lib 文件
import * as USA from "fusioncharts/maps/fusioncharts.usa";
对于其他地图定义文件,请下载此包 - https://www.npmjs.com/package/fusionmaps
Fusioncharts 地图遇到此错误
fusioncharts.js:19 GET http://localhost:8100/fusioncharts.usa.js net::ERR_ABORTED 404 (Not Found)
HTML
<fusioncharts width="100%" height="200" type="usa" dataFormat="json"
[dataSource]="geographicDistributionDataSource">
</fusioncharts>
module.ts
import { FusionChartsModule } from 'angular-fusioncharts';
// Import FusionCharts library and chart modules
import * as FusionCharts from "fusioncharts";
import * as FusionMaps from "fusioncharts/fusioncharts.maps";
import * as Charts from "fusioncharts/fusioncharts.charts";
import * as Widgets from "fusioncharts/fusioncharts.widgets";
import * as Gantt from "fusioncharts/fusioncharts.gantt";
import * as Powercharts from "fusioncharts/fusioncharts.powercharts";
import * as Msstackedcolumn2dsplinedy from "fusioncharts/fusioncharts.msstackedcolumn2dsplinedy";
import * as FusionTheme from "fusioncharts/themes/fusioncharts.theme.fusion";
import * as MultiCharts from "fusioncharts/fusioncharts.zoomline";
import { ModalModule } from './component/modal/modal.module';
// Pass the fusioncharts library and chart modules
FusionChartsModule.fcRoot(FusionCharts, FusionMaps, FusionTheme, Charts, Gantt, Widgets,
Powercharts, Msstackedcolumn2dsplinedy, MultiCharts);
@NgModule({
declarations: [],
imports: [
FusionChartsModule
],
exports: [
FusionChartsModule
]
})
您需要在 module.ts
中导入 USA lib 文件import * as USA from "fusioncharts/maps/fusioncharts.usa";
对于其他地图定义文件,请下载此包 - https://www.npmjs.com/package/fusionmaps