/*$(document).ready(function () {
var obj = new Object();
$.ajax({
url : prefix + "/queryXinGuanJieZhongShuLiang",
method : 'post',
data : obj,
success : function (e) {
if(e.code == 0){
jieZhongShuLiang(e);
}
}
});
});*/
function jieZhongShuLiang(e){//疫苗接种数量统计
var jieZhongShuLiang = e.jieZhongShuLiang;
var jzAll = 0;
for (var i = 0; i < jieZhongShuLiang.length; i++) {
jzAll += jieZhongShuLiang[i].jzNumber;
}
var container = document.getElementById("ymjzsl");
container.innerHTML = "";
for (var i = 0; i < jieZhongShuLiang.length; i++) {
var box = $("
");
$(container).append(box);
var content = $("");
box.append(content);
content.append(""+jieZhongShuLiang[i].jdName.substr(0, 4)+"
");
var chart = $("");
content.append(chart);
content.append(""+jieZhongShuLiang[i].rkNumber+"
");
content.append("辖区居民总数
");
content.append(""+jieZhongShuLiang[i].jzNumber+"
");
content.append("实际接种人数
");
var myChart = echarts.init(chart[0]);
myChart.on("click", function (e) {
openDialog_jzsl(e.dataIndex);
});
var option;
option = {
tooltip: {
trigger: 'item',
position:'inside'
},
series: [
{
name: '占全区接种人数百分比',
type: 'pie',
radius: ['60%', '70%'],
selectedOffset:0, //选中块的偏移量
// emphasis: {
// label: {
// show: true,
// fontSize: '15',
// fontWeight: 'bold',
// color:'83bff6'
//
// }
// },
labelLine: {
show: false
},
data: [
{
value: jieZhongShuLiang[i].jzNumber,
name: '本街道接种',
itemStyle: {
color: new echarts.graphic.LinearGradient(1, 1, 0, 0, [{
offset: 0,
color: '#1270d9'
}, {
offset: 1,
color: '#00ffeb'
}]),
},
selected:true, //默认选中第一块
label: {
normal:{
show: true,
fontSize: '15',
position: 'center',
textStyle:{
color:'#fff',
fontWeight: 'bold',
},
formatter: '{d}%'
}
},
},
{
value: (jzAll - jieZhongShuLiang[i].jzNumber),
name: '其他街道接种',
itemStyle: {
color: new echarts.graphic.LinearGradient(1, 1, 0, 0, [{
offset: 0,
color: '#ff8404'
}, {
offset: 1,
color: '#ffd904'
}]),
},
label:{
show:false, //默认显示第一块
}
},
]
}
]
};
option && myChart.setOption(option);
}
}
function openDialog_jzsl(index) {//弹出对话框
console.log(index+"=index")
var url = prefix + "/xgym/jzsl/" + index;
var title
switch (index){
case 0:
title = '疫苗接种数量统计 - 已接种';
break;
case 1:
title = '疫苗接种数量统计 - 未接种';
break;
}
$.modal.openDetailFull(title, url, 1200);
}