Ошибка типа диаграммы Highchart с ионным приложением - PullRequest
0 голосов
/ 04 октября 2019

Реализация организационной диаграммы Highcharts с использованием ионного приложения с использованием https://www.highcharts.com/docs/chart-and-series-types/organization-chart привела к следующей ошибке

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);

Как мне исправить проблему?

1 Ответ

1 голос
/ 05 октября 2019

Попробуйте импортировать это так:

import * as Highcharts from "highcharts";
import * as Sankey from "highcharts/modules/sankey";
import * as Organization from "highcharts/modules/organization";
import * as HighchartsExporting from "highcharts/modules/exporting";

Sankey(Highcharts);
Organization(Highcharts);
HighchartsExporting(Highcharts);

Демо-версия Angular:

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...