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.
|
|
|
|
var myCharts2 = echarts.init(document.getElementById('chinaConfirmed'))
|
|
|
|
|
|
|
|
|
|
var option2 = {
|
|
|
|
|
//backgroundColor: '#2c343c',
|
|
|
|
|
tooltip: {
|
|
|
|
|
trigger: 'item',
|
|
|
|
|
formatter: "省份:{b}<br/>确诊:{c}"
|
|
|
|
|
},
|
|
|
|
|
textStyle: {color: '#FFFFFF'},
|
|
|
|
|
title:{
|
|
|
|
|
left: 'center',
|
|
|
|
|
text: '中国疫情地图(累积确诊人数)',
|
|
|
|
|
subtext: '',
|
|
|
|
|
textStyle:{
|
|
|
|
|
color:"rgba(0,0,0)",
|
|
|
|
|
fontSize:20,
|
|
|
|
|
align:"center"
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
visualMap: {
|
|
|
|
|
left: 'left',
|
|
|
|
|
top: 'bottom',
|
|
|
|
|
splitNumber: 7,
|
|
|
|
|
pieces: [
|
|
|
|
|
{value: 0},
|
|
|
|
|
{min: 0, max: 9},
|
|
|
|
|
{min: 10, max: 49},
|
|
|
|
|
{min: 50, max: 99},
|
|
|
|
|
{min: 100, max: 999},
|
|
|
|
|
{min: 1000, max: 9999},
|
|
|
|
|
{min: 10000}
|
|
|
|
|
],
|
|
|
|
|
textStyle: {
|
|
|
|
|
color: "rgba(0, 0, 0, 0.2)"
|
|
|
|
|
},
|
|
|
|
|
inRange: {
|
|
|
|
|
color: ["#FFFFFF", "#FFE5DB", "#FFC4B3", "#FF9985", "#F57567", "#E64546", "#B80909"]
|
|
|
|
|
},
|
|
|
|
|
outOfRange: {
|
|
|
|
|
color: "#FFFFFF"
|
|
|
|
|
},
|
|
|
|
|
show:true
|
|
|
|
|
},
|
|
|
|
|
geo:{
|
|
|
|
|
map:'china',
|
|
|
|
|
roam:false,//不开启缩放和平移
|
|
|
|
|
zoom:1.23,//视角缩放比例
|
|
|
|
|
label: {
|
|
|
|
|
normal: {
|
|
|
|
|
show: true,
|
|
|
|
|
fontSize:'11',
|
|
|
|
|
color: '#6C6C6C'
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
itemStyle: {
|
|
|
|
|
normal:{
|
|
|
|
|
borderColor: 'rgba(0, 0, 0, 0.2)'
|
|
|
|
|
},
|
|
|
|
|
emphasis:{
|
|
|
|
|
areaColor: '#FFFF00',//鼠标悬停区域颜色
|
|
|
|
|
shadowOffsetX: 0,
|
|
|
|
|
shadowOffsetY: 0,
|
|
|
|
|
shadowBlur: 20,
|
|
|
|
|
borderWidth: 0,
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
series:[{
|
|
|
|
|
name:'现有确诊',
|
|
|
|
|
type:'map',
|
|
|
|
|
map:'china',
|
|
|
|
|
geoIndex: 0,
|
|
|
|
|
roam: true,
|
|
|
|
|
label: {
|
|
|
|
|
normal: {
|
|
|
|
|
show: true,
|
|
|
|
|
textStyle:{
|
|
|
|
|
color: 'rgb(0, 0, 0)',
|
|
|
|
|
fontSize: 14
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
data:[]
|
|
|
|
|
}]
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
$.ajax({
|
|
|
|
|
cache: false,
|
|
|
|
|
url:'/chinaConfirmed',
|
|
|
|
|
type:"GET",
|
|
|
|
|
dataType:'json',
|
|
|
|
|
async:false,
|
|
|
|
|
error: function(request) {
|
|
|
|
|
alert("发送请求失败!2");
|
|
|
|
|
},
|
|
|
|
|
success: function(result) {
|
|
|
|
|
//time,curConfirmed,area
|
|
|
|
|
option2.title.subtext="数据更新时间为:"+result.time+" 单位:例"
|
|
|
|
|
for(i=0,max=result.area.length; i<max; ++i) {
|
|
|
|
|
option2.series[0].data.push({name:result.area[i], value:result.confirmed[i]})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
myCharts2.setOption(option2);
|