未捕获的错误:使用react创建森伯斯特图表时出现Highcharts错误#17

时间:2018-08-20 09:57:53

标签: javascript reactjs highcharts sunburst-diagram react-highcharts

enter image description here Document link for "data" i am using in chart

我正在使用ReactHighcharts组件来渲染图表,所有其他图表(如折线图,条形图,面积图,列图)都可以正常工作,但是当我尝试使用旭日形图时,我遇到了此错误。

我无法确定此错误的原因。请让我知道我在做什么错。

   const sunburstconfig = {
        title: {
            text: 'World population 2017'
        },
        credits: {
          enabled: false
        },

        series: [{
            type: "sunburst",
            data: data,
            allowDrillToNode: true,
            cursor: 'pointer',
            }]

    };

    <ReactHighcharts config={sunburstconfig}></ReactHighcharts>

1 个答案:

答案 0 :(得分:0)

您需要在React应用中导入森伯斯特模块:

import '...'

文档:https://www.highcharts.com/blog/frameworks/react/192-use-highcharts-to-create-charts-in-react/