const { typeChart } = this.props; let echartData = []; if(typeChart){ for(var i in typeChart){ echartData.push({name:typeChart[i].x,value:typeChart[i].y}) ; } }