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.
p9ew5o3q7/app/static/js/outside_diedAndcrued.js

80 lines
1.7 KiB

ec=echarts.init(document.getElementById("outside_diedAndcrued"))
var option1 = {
title: {
text: '国外累积治愈/累积死亡趋势',
subtext:'单位:例',
left: 'left',
textStyle:{
color:'black',
}
},
tooltip: {
trigger: 'axis'
},
legend: {
left:'right',
top:'30',
data: ['死亡', '治愈']
},
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
toolbox: {
feature: {
saveAsImage: {}
}
},
xAxis: {
type: 'category',
boundaryGap: false,
data: []
},
yAxis: {
axisLine: {
show: false
},
type: 'value'
},
series: [
{
name: '死亡',
type: 'line',
stack: '总量',
data: []
},
{
name: '治愈',
type: 'line',
stack: '总量',
data: []
}
]
};
$.ajax({
cache: false,
type:"GET",
url:"/outside_diedAndcrued",
data: null,
dataType : "json",
async: false,
error: function(request) {
alert("发送请求失败13");
},
success: function(result) {
// confirmed,curConfirmed,date
for(i=0;i<result.date.length;++i) {
option1.series[0].data.push(result.crued[i])
option1.series[1].data.push(result.died[i])
option1.xAxis.data.push(result.date[i])
}
console.info(result)
}
});
ec.setOption(option1)