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.
108 lines
2.7 KiB
108 lines
2.7 KiB
var myCharts4 = echarts.init(document.getElementById('main4'));
|
|
|
|
var option4 = {
|
|
backgroundColor: 'rgba(0, 178, 255, 0.89)',
|
|
tooltip: {
|
|
trigger: 'item',
|
|
formatter: "国家:{b}<br/>确诊:{c}"
|
|
},
|
|
textStyle: {color: '#FFFFFF'},
|
|
title:{
|
|
left: 'center',
|
|
text: '世界疫情地图(现有确诊人数)',
|
|
subtext: '数据更新时间: ',
|
|
textStyle:{
|
|
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: "#B80909"
|
|
},
|
|
inRange: {
|
|
color: ["#FFFFFF", "#FFE5DB", "#FFC4B3", "#FF9985", "#F57567", "#E64546", "#B80909"]
|
|
},
|
|
outOfRange: {
|
|
color: "#FFFFFF"
|
|
},
|
|
show:true
|
|
},
|
|
geo:{
|
|
map:'world',
|
|
roam:false,//不开启缩放和平移
|
|
zoom:1.23,//视角缩放比例
|
|
label: {
|
|
normal: {
|
|
show: true,
|
|
fontSize:'11',
|
|
color: '#6C6C6C'
|
|
}
|
|
},
|
|
itemStyle: {
|
|
normal:{
|
|
borderColor: 'rgba(0, 0, 0, 0.2)'
|
|
},
|
|
emphasis:{
|
|
areaColor: '#FF0000',//鼠标悬停区域颜色
|
|
shadowOffsetX: 0,
|
|
shadowOffsetY: 0,
|
|
shadowBlur: 20,
|
|
borderWidth: 0,
|
|
shadowColor: 'rgba(255, 255, 255, 0.5)'
|
|
}
|
|
}
|
|
},
|
|
series:[{
|
|
name:'现有确诊',
|
|
type:'map',
|
|
map:'world',
|
|
geoIndex: 0,
|
|
roam: true,
|
|
label: {
|
|
normal: {
|
|
show: true,
|
|
textStyle:{
|
|
color: 'rgb(0, 0, 0)',
|
|
fontSize: 14
|
|
}
|
|
}
|
|
},
|
|
data:[
|
|
|
|
]
|
|
}]
|
|
};
|
|
|
|
$.ajax({
|
|
cache: false,
|
|
url:'/country_curconfirm',
|
|
type:"GET",
|
|
dataType:'json',
|
|
async:false,
|
|
error: function(request) {
|
|
alert("发送请求失败!");
|
|
},
|
|
success: function(result) {
|
|
console.info('+++++ my_world.js')
|
|
console.info(result)
|
|
for(i=0,max=result.provinces.length; i<max; ++i) {
|
|
option4.series[0].data.push({name:result.provinces[i], value:result.curConfirms[i]})
|
|
}
|
|
option4.title.subtext = '数据更新时间: ' + result.pub_date
|
|
}
|
|
});
|
|
|
|
myCharts4.setOption(option4); |