var myCharts2 = echarts.init(document.getElementById('chinaCurconfirmed'))
var option2 = {
//backgroundColor: '#2c343c',
tooltip: {
trigger: 'item',
formatter: "省份:{b}
确诊:{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:'/chinaCurconfirmed',
type:"GET",
dataType:'json',
async:false,
error: function(request) {
alert("发送请求失败!3");
},
success: function(result) {
//time,curConfirmed,area
option2.title.subtext="数据更新时间为:"+result.time+" 单位:例"
for(i=0,max=result.area.length; i