首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >日照角图

日照角图
EN

Stack Overflow用户
提问于 2019-09-05 11:05:34
回答 2查看 1.8K关注 0票数 1

嗨,我正在使用高海图的太阳暴晒图,但有错误,我无法得到什么是我的代码错误,所以请帮助我。

我的HTML代码是:

代码语言:javascript
复制
<highcharts-chart
    [Highcharts]="highcharts1"
    [options]="chartOptions1"
    style="width: 100%; height: 200px; display: block;">
  </highcharts-chart>

而Ts代码是

代码语言:javascript
复制
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)”有人能帮助我在我的代码中缺少什么吗?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2019-09-05 11:57:37

您需要导入并初始化sunburst模块:

代码语言:javascript
复制
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

票数 1
EN

Stack Overflow用户

发布于 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

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/57804093

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档