Highcharts角度依赖关系轮

huangapple go评论114阅读模式
英文:

Highcharts angular dependency-wheel

问题

我一直在尝试使用Highcharts-angular库实现依赖轮图表:https://github.com/highcharts/highcharts-angular

我创建了一个带有最小配置的简单stackBlitz示例,但我不断收到错误#17:所请求的系列类型不存在。

https://stackblitz.com/edit/angular-zmmban?file=src/app/app.component.html

为什么它不起作用?我尝试将其添加到导入语句中,但某些图表没有要导入的ts文件(其中包括依赖轮图)。

英文:

I have been trying to implement the dependency-wheel chart from the Highcharts-angular Library: https://github.com/highcharts/highcharts-angular

I made a simple stackBlitz with minimal configuration but i keep getting error #17 : The requested series type does not exist.

https://stackblitz.com/edit/angular-zmmban?file=src/app/app.component.html

Why is it not working? i tried adding it in the import statements but there is no ts file to import for some charts (the dependency-wheel being among them)

答案1

得分: 2

请注意,dependency-wheel 需要导入两个额外的模块来渲染 - sankey.js 和 dependendency-wheel.js。将它们导入到您的应用程序将修复错误。

import HC_sankey from 'highcharts/modules/sankey';
import HC_depwheel from 'highcharts/modules/dependency-wheel';

HC_sankey(Highcharts);
HC_depwheel(Highcharts);

演示: https://stackblitz.com/edit/angular-3cdwh1?file=src/app/app.component.ts

API 文档: https://www.highcharts.com/docs/chart-and-series-types/dependency-wheel

英文:

Notice that dependency-wheel requires two extra modules to render - sankey.js and dependendency-wheel.js. Importing them to your app will fix the error.

import HC_sankey from 'highcharts/modules/sankey';
import HC_depwheel from 'highcharts/modules/dependency-wheel';

HC_sankey(Highcharts);
HC_depwheel(Highcharts);

Demo: https://stackblitz.com/edit/angular-3cdwh1?file=src/app/app.component.ts


API: https://www.highcharts.com/docs/chart-and-series-types/dependency-wheel

huangapple
  • 本文由 发表于 2020年1月7日 00:16:20
  • 转载请务必保留本文链接:https://go.coder-hub.com/59615445.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定