如何解决“必须为HighchartsChart组件指定配置”错误?

时间:2018-01-17 13:16:57

标签: reactjs highcharts react-highcharts

插入之前

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

<div className="col-md-6 mb-3">
    <div className="card">
        <div className="card-header d-flex">
            <h5 className="card-title mr-auto"> Team Wise Total Revenue</h5>
        </div>                      
        <div className="card-body">
            <figure>

            </figure>
        </div>      
    </div>
</div>

让barchartdata = this.state.reports.chartslist.charts [0];

console.log(“databarchart”,this.state.reports.chartslist.charts [0]);

我能够获取数据。

   <div className="col-md-6 mb-3">
<div className="card">
    <div className="card-header d-flex">
        <h5 className="card-title mr-auto"> Team Wise Total Revenue</h5>
    </div>                      
    <div className="card-body">
        <figure>
            <ReactHighcharts config={barchartdata}></ReactHighcharts>
        </figure>
    </div>      
</div>

barchartdata has following response too:

config must be specified error

0 个答案:

没有答案