[英]Sunburst chart in angular
Hi I am using Highchart for sunburst chart, But getting errors, I am not able to get what is wrong in my code, so please help me. 嗨,我正在使用Highchart作森伯斯特图表,但是遇到错误,我无法得到代码中的错误,因此请帮助我。
My HTML code is : 我的HTML代码是:
<highcharts-chart
[Highcharts]="highcharts1"
[options]="chartOptions1"
style="width: 100%; height: 200px; display: block;">
</highcharts-chart>
and Ts code is Ts代码是
chartData = [
{
id: '2.13',
parent: '1.3',
name: 'Southern Asia'
}
];
highcharts1: typeof Highcharts = Highcharts;
chartOptions1: Highcharts.Options = <any> {
chart: {
height: '100%'
},
title: {
text: 'World population 2017'
},
subtitle: {
text: 'Source <href="https://en.wikipedia.org/wiki/List_of_countries_by_population_(United_Nations)">Wikipedia</a>'
},
series: [{
type: "sunburst",
data: this.chartData,
allowDrillToNode: true,
cursor: 'pointer',
dataLabels: {
format: '{point.name}',
filter: {
property: 'innerArcLength',
operator: '>',
value: 16
}
},
levels: [{
level: 1,
levelIsConstant: false,
dataLabels: {
filter: {
property: 'outerArcLength',
operator: '>',
value: 64
}
}
}, {
level: 2,
colorByPoint: true
},
{
level: 3,
colorVariation: {
key: 'brightness',
to: -0.5
}
}, {
level: 4,
colorVariation: {
key: 'brightness',
to: 0.5
}
}]
}]
};
" getting the below error. ERROR Error: Highcharts error #17: www.highcharts.com/errors/17 at c.Chart.h (highcharts.js:12) " Can anyone help me what i am missing in my code “出现以下错误。错误错误:Highcharts错误#17:www.highcharts.com/errors/17 at c.Chart.h(highcharts.js:12)”任何人都可以帮助我在代码中缺少的内容
The sunburst chart requires the following module modules/sunburst.js. 朝阳图需要以下模块modules / sunburst.js。
Sunburst.js location: https://code.highcharts.com/modules/sunburst.js Sunburst.js位置: https : //code.highcharts.com/modules/sunburst.js
API Reference: https://www.highcharts.com/docs/chart-and-series-types/sunburst-series API参考: https : //www.highcharts.com/docs/chart-and-series-types/sunburst-series
You need to import and initialize the sunburst
module: 您需要导入并初始化sunburst
模块:
import * as Highcharts from 'highcharts';
import HC_sunburst from 'highcharts/modules/sunburst';
HC_sunburst(Highcharts);
Docs: https://github.com/highcharts/highcharts-angular#to-load-a-module 文件: https : //github.com/highcharts/highcharts-angular#to-load-a-module
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.