You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
855 B
38 lines
855 B
var myCharts10 = echarts.init(document.getElementById("main10"));
|
|
var option10 = {
|
|
xAxis: {
|
|
type: 'category',
|
|
data: []
|
|
},
|
|
yAxis: {
|
|
type: 'value'
|
|
},
|
|
series: [{
|
|
data: [],
|
|
type: 'line'
|
|
}]
|
|
};
|
|
|
|
// 向后台发起请求,获取数据
|
|
$.ajax({
|
|
cache: false,
|
|
type:"GET",
|
|
url:"/province_curconfirm",
|
|
data: null,
|
|
dataType : "json",
|
|
async: false,
|
|
error: function(request) {
|
|
alert("发送请求失败!");
|
|
},
|
|
success: function(result) {
|
|
// pub_date, privinces, curConfirms
|
|
for(i=0; i<result.provinces.length; ++i) {
|
|
option10.xAxis.data.push(result.provinces[i])
|
|
option10.series[0].data.push(result.curConfirms[i])
|
|
}
|
|
print(result)
|
|
console.info(result)
|
|
}
|
|
});
|
|
|
|
myCharts10.setOption(option10); |