使用https://www.highcharts.com/docs/chart-and-series-types/organization-chart的离子应用程序实施Highcharts组织结构图导致以下错误
ERROR in src/app/home/home.page.ts:29:11 - error TS2322: Type 'string' is not assignable to type '"area" | "map" | "line" | "polygon" | "item" | "abands" | "ad" | "ao" | "apo" | "arearange" | "areaspline" | "areasplinerange" | "aroon" | "aroonoscillator" | "atr" | "bar" | "bb" | ... 80 more ... | "zigzag"'.
[ng] 29 type: 'organization',
[ng] ~~~~
[ng] node_modules/highcharts/highcharts.d.ts:189657:5
[ng] 189657 type: "abands";
[ng] ~~~~
[ng] The expected type comes from property 'type' which is declared here on type 'SeriesAbandsOptions | SeriesAdOptions | SeriesAoOptions | SeriesApoOptions | SeriesAreaOptions | SeriesArearangeOptions | SeriesAreasplineOptions | SeriesAreasplinerangeOptions | ... 89 more ... | SeriesZigzagOptions'
[ng]
我在index.html文件中包含了所需的脚本。
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/sankey.js"></script>
<script src="https://code.highcharts.com/modules/organization.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
import * as HighCharts from 'highcharts';
import highcharts from "highcharts/modules/organization";
highcharts(HighCharts);
如何解决此问题?
尝试这样导入: