加载模块时highcharts组织图抛出错误

Sre*_*ari 4 javascript highcharts highcharts-ng angular2-highcharts angular

我正在尝试使用 highcharts 和 highcharts-angular 生成组织结构图。但是,它在加载组织结构图模块时抛出以下错误。

organization.js:9 Uncaught TypeError: Cannot read property 'prototype' of undefined
at organization.js:9
at e (organization.js:9)
at organization.js:9
at Module../src/app/my-network-chart/my-network-chart.component.ts (my-network-chart.component.ts:9)
at __webpack_require__ (bootstrap:78)
at Module../src/app/app.module.ts (app.component.ts:8)
at __webpack_require__ (bootstrap:78)
at Module../src/main.ts (main.ts:1)
at __webpack_require__ (bootstrap:78)
at Object.0 (main.ts:12)
Run Code Online (Sandbox Code Playgroud)

我做错了什么吗?我正在使用相同的代码来生成网络图表,并且它没有任何问题。我只在组织结构图中面临这个问题。

加载组织图:

import { Component, OnInit } from '@angular/core';
import * as Highcharts from 'highcharts';
import HighchartsOrganization from "highcharts/modules/organization";
import HighchartsExporting from "highcharts/modules/exporting";

HighchartsOrganization(Highcharts);
HighchartsExporting(Highcharts);
Run Code Online (Sandbox Code Playgroud)

加载网络图表:在这种情况下没有问题

import { Component, OnInit } from '@angular/core';
import * as Highcharts from 'highcharts';
import HighchartsNetworkgraph from "highcharts/modules/networkgraph";
import HighchartsExporting from "highcharts/modules/exporting";

HighchartsNetworkgraph(Highcharts);
HighchartsExporting(Highcharts);
Run Code Online (Sandbox Code Playgroud)

she*_*lak 5

组织结构图模块需要的热平衡图模块,所以你需要进口,首先,如:

import { Component, OnInit } from '@angular/core';
import * as Highcharts from 'highcharts';
import HighchartsSankey from "highcharts/modules/sankey";
import HighchartsOrganization from "highcharts/modules/organization";
import HighchartsExporting from "highcharts/modules/exporting";

HighchartsSankey(Highcharts);
HighchartsOrganization(Highcharts);
HighchartsExporting(Highcharts);
Run Code Online (Sandbox Code Playgroud)

请参阅导入 sankey.js 的官方Highcharts Organization 示例