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.
141 lines
3.9 KiB
141 lines
3.9 KiB
var myCharts3 = echarts.init(document.getElementById('main3'));
|
|
|
|
var option3 = {
|
|
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:'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: '#FF0000',//鼠标悬停区域颜色
|
|
shadowOffsetX: 0,
|
|
shadowOffsetY: 0,
|
|
shadowBlur: 20,
|
|
borderWidth: 0,
|
|
shadowColor: 'rgba(255, 255, 255, 0.5)'
|
|
}
|
|
}
|
|
},
|
|
series:[{
|
|
name:'现有确诊',
|
|
type:'map',
|
|
map:'china',
|
|
geoIndex: 0,
|
|
roam: true,
|
|
label: {
|
|
normal: {
|
|
show: true,
|
|
textStyle:{
|
|
color: 'rgb(0, 0, 0)',
|
|
fontSize: 14
|
|
}
|
|
}
|
|
},
|
|
data:[
|
|
// {name:"南海诸岛",value:0},
|
|
// {name: '北京', value: 97},
|
|
// {name: '天津', value: 5},
|
|
// {name: '上海', value: 30},
|
|
// {name: '重庆', value: 2},
|
|
// {name: '河北', value: 2},
|
|
// {name: '河南', value: 1},
|
|
// {name: '云南', value: 2},
|
|
// {name: '辽宁', value: 4},
|
|
// {name: '黑龙江', value: 13},
|
|
// {name: '湖南', value: 0},
|
|
// {name: '安徽', value: 0},
|
|
// {name: '山东', value: 9},
|
|
// {name: '新疆', value: 0},
|
|
// {name: '江苏', value: 5},
|
|
// {name: '浙江', value: 15},
|
|
// {name: '江西', value: 1},
|
|
// {name: '湖北', value: 8685},
|
|
// {name: '广西', value: 3},
|
|
// {name: '甘肃', value: 40},
|
|
// {name: '山西', value: 1},
|
|
// {name: '内蒙古', value: 1},
|
|
// {name: '陕西', value: 7},
|
|
// {name: '吉林', value: 0},
|
|
// {name: '福建', value: 0},
|
|
// {name: '贵州', value: 0},
|
|
// {name: '广东', value: 49},
|
|
// {name: '青海', value: 0},
|
|
// {name: '西藏', value: 0},
|
|
// {name: '四川', value: 17},
|
|
// {name: '宁夏', value: 0},
|
|
// {name: '海南', value: 1},
|
|
// {name: '台湾', value: 54},
|
|
// {name: '香港', value: 70},
|
|
// {name: '澳门', value: 2}
|
|
]
|
|
}]
|
|
};
|
|
|
|
$.ajax({
|
|
cache: false,
|
|
url:'/province_curconfirm',
|
|
type:"GET",
|
|
dataType:'json',
|
|
async:false,
|
|
error: function(request) {
|
|
alert("发送请求失败!");
|
|
},
|
|
success: function(result) {
|
|
console.info('+++++ my_china.js')
|
|
console.info(result)
|
|
for(i=0,max=result.provinces.length; i<max; ++i) {
|
|
option3.series[0].data.push({name:result.provinces[i], value:result.curConfirms[i]})
|
|
}
|
|
option3.title.subtext = '数据更新时间: ' + result.pub_date
|
|
}
|
|
});
|
|
|
|
myCharts3.setOption(option3); |