嗨,我正在使用高海图的太阳暴晒图,但有错误,我无法得到什么是我的代码错误,所以请帮助我。
我的HTML代码是:
<highcharts-chart
[Highcharts]="highcharts1"
[options]="chartOptions1"
style="width: 100%; height: 200px; display: block;">
</highcharts-chart>而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
}
}]
}]
};“获取以下错误。错误:高级图表错误#17: www.Highcharts.com/ error /17 at c.Chart.h (highcharts.js:12)”有人能帮助我在我的代码中缺少什么吗?
发布于 2019-09-05 11:57:37
您需要导入并初始化sunburst模块:
import * as Highcharts from 'highcharts';
import HC_sunburst from 'highcharts/modules/sunburst';
HC_sunburst(Highcharts);文档: https://github.com/highcharts/highcharts-angular#to-load-a-module
发布于 2019-09-05 11:11:44
sunburst图表需要以下模块模块/sunburst.js。
Sunburst.js location: https://code.highcharts.com/modules/sunburst.js
API参考: https://www.highcharts.com/docs/chart-and-series-types/sunburst-series
https://stackoverflow.com/questions/57804093
复制相似问题