option = {..........}//这里内容可以直接从Echat自带的列子中取
myChart.setOption(option);//将图表内容格式内容放入到myChart位置
$.ajax({
type:"post",
async:false,
url:“/mobilePopulation/Geo.do”,//请求路径
dataType:"json",//返回数据形式为json
data:_data,
success:function(result){
if(result){
options.legend.data = result.legend; //legend赋值数据
options.xAxis[0].data= result[0].xdata;//x轴赋值数据
options.series[0].data= result[0].data;//y轴赋值数据
myChart.hideLoading();
myChart.setOption(options);
}
},
error:function(errorMsg){
alert("图表请求数据失败啦!");
myChart.hideLoading();
}
})
}