【问题标题】:Getting error while using highcharts in Angular 7在 Angular 7 中使用 highcharts 时出错
【发布时间】:2019-08-22 21:13:29
【问题描述】:

我正在尝试高图表。我通过 cli 创建了新的 angular 应用程序并安装了 highcharts 和 highcharts-angular。我从他们的 github 页面复制了代码。在第一次运行时,我遇到了以下错误。

ERROR in node_modules/highcharts/highcharts.d.ts(128972,17): error TS2304: Cannot find name 'PlotNetworkDataLabelsFormatterCallbackFunction'.
node_modules/highcharts/highcharts.d.ts(128982,21): error TS2304: Cannot find name 'PlotNetworkDataLabelsFormatterCallbackFunction'.
node_modules/highcharts/highcharts.d.ts(128987,19): error TS2304: Cannot find name 'PlotNetworkDataLabelsTextPath'.
node_modules/highcharts/highcharts.d.ts(128992,15): error TS2304: Cannot find name 'PlotNetworkDataLabelsTextPath'.
node_modules/highcharts/highcharts.d.ts(136653,17): error TS2304: Cannot find name 'PlotPackedBubbleDataLabelsFormatterCallbackFunction'.
node_modules/highcharts/highcharts.d.ts(136658,15): error TS2304: Cannot find name 'PlotPackedBubbleDataLabelsTextPath'.node_modules/highcharts/highcharts.d.ts(237720,14): 
error TS2304: Cannot find name 'SeriesOrganizationNodesLayoutValues'.

我使用

从 npm 安装了 highcharts

npm install highcharts-angular --save

npm install highcharts --save

然后我在 app.module.ts 中导入 HighchartsChartModule 并从 highcharts-angular 导入数组。在 app.component.ts 和 app.component.html 我从他们的github 页面添加了示例代码。

我遇到了错误。我应该安装任何插件或依赖项吗?

【问题讨论】:

  • 您能添加一个 StackBlitz 示例吗?这是一个有效的StackBlitz example。以上是我需要安装的仅有的两个包。

标签: javascript angular highcharts


【解决方案1】:

我们遇到了同样的问题。 Highcharts 7 小时前今天发布了 7.1.0。从那以后,我们无法使用 7.1.0 构建。如果我们锁定到 7.0.3 构建很好。希望那里的人会看到这一点,并且今天会发布 7.1.1。

我还添加了issue to their repo here

【讨论】:

    猜你喜欢
    • 2020-06-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-10-27
    • 1970-01-01
    • 2023-04-08
    • 1970-01-01
    • 2022-01-04
    相关资源
    最近更新 更多