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.

107 lines
2.7 KiB

var myCharts6 = echarts.init(document.getElementById('main6'));
var option6 = {
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: "rgba(21, 255, 0, 1)"
},
inRange: {
color: ["rgba(21, 255, 0, 0)", "rgba(21, 255, 0, 0.2)", "rgba(21, 255, 0, 0.4)", "rgba(21, 255, 0, 0.5)", "rgba(21, 255, 0, 0.6)", "rgba(21, 255, 0, 0.8)", "rgba(21, 255, 0, 1)"]
},
outOfRange: {
color: "#FFFFFF"
},
show:true
},
geo:{
map:'河南',
roam:false,//不开启缩放和平移
zoom:1.23,//视角缩放比例
label: {
normal: {
show: true,
fontSize:'11',
color: '#6C6C6C'
}
},
itemStyle: {
normal:{
borderColor: 'rgba(0, 0, 0, 0.2)'
},
emphasis:{
areaColor: 'rgba(21, 255, 0, 1)',//鼠标悬停区域颜色
shadowOffsetX: 0,
shadowOffsetY: 0,
shadowBlur: 20,
borderWidth: 0,
shadowColor: 'rgba(255, 255, 255, 0.5)'
}
}
},
series:[{
name:'现有确诊',
type:'map',
map:'河南',
geoIndex: 0,
roam: true,
label: {
normal: {
show: true,
textStyle:{
color: 'rgb(0, 0, 0)',
fontSize: 14
}
}
},
data:[
]
}]
};
$.ajax({
cache: false,
url:'/henan_curconfirm',
type:"GET",
dataType:'json',
async:false,
error: function(request) {
alert("发送请求失败!");
},
success: function(result) {
console.info('+++++ myhome.js')
console.info(result)
for(i=0,max=result.provinces.length; i<max; ++i) {
option6.series[0].data.push({name:result.provinces[i], value:result.curConfirms[i]})
}
option6.title.subtext = '数据更新时间: ' + result.pub_date
}
});
myCharts6.setOption(option6);