【发布时间】: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 安装了 highchartsnpm 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