gpt4 book ai didi

javascript - Angular 旭日图

转载 作者:行者123 更新时间:2023-11-30 13:53:13 24 4
gpt4 key购买 nike

您好,我正在使用 Highchart 制作旭日图,但是出现错误,我无法找出代码中的错误,所以请帮助我。

我的 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
}
}]

}]
};

"出现以下错误。 错误错误:Highcharts 错误 #17:www.highcharts.com/errors/17 在 c.Chart.h(highcharts.js:12)“谁能帮我解决我在代码中遗漏的问题

最佳答案

您需要导入并初始化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

关于javascript - Angular 旭日图,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57804093/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com