英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论