Files
number_zj/portal/h5/nongcun/1.js
2022-01-11 14:22:25 +08:00

399 lines
8.6 KiB
JavaScript

var myChart61 = echarts.init(document.querySelector(".echart61"))
//省级美丽宜居示范村创建
var taskId2 = '229185203687473152'
var quotaCode2 = 'Q229262828229443587'
var url2 =
'https://sznbs.ningbo.gov.cn:89/nbszhjkzz/tojcms/getQuotaByTaksIdOrQuotaCode.do?parentQuotaCode=' +
quotaCode2 +
'&systemName=government'
$.post(url2, function (data) {
var d = unique(data.infoList)
var mubiao2 = countTotal(d, 'targetValue')
var nb_value = countTotal(d, 'currentValue')
$('#CJmubiao').html(mubiao2)
$('#CJshiji').html(nb_value)
/* $('#lblmubiaowanchenglv2').html((nb_value / mubiao2) * 100)
*/
var nb_value_lv = (nb_value / mubiao2) * 100
/* 百分比图 */
var option61 = {
tooltip: {
trigger: "item",
formatter: "{b} {c} %",
},
graphic: {
type: "text",
left: "center",
top: "center",
width: 30,
style: {
text: "" + nb_value_lv + "%",
fill: "#228DF8",
fontSize: 18,
fontWeight: 700,
},
},
series: [
{
name: "",
type: "pie",
radius: ["70%", "90%"],
avoidLabelOverlap: false,
label: {
show: false,
},
emphasis: {
label: {
show: false,
},
},
labelLine: {
show: true,
},
data: [
{
value: nb_value_lv,
name: "",
itemStyle: {
normal: {
color: "#3E9DF4",
label: {
show: true,
formatter: "{c}%",
},
},
},
},
],
},
],
}
myChart61.setOption(option61)
})
var myChart62 = echarts.init(document.querySelector(".echart62"))
var taskId2 = "229185203687473152"
var quotaCode2 = "Q229262828229443587"
var url2 =
"https://sznbs.ningbo.gov.cn:89/nbszhjkzz/tojcms/getQuotaByTaksIdOrQuotaCode.do?parentQuotaCode=" +
quotaCode2 +
"&systemName=government"
$.post(url2, function(data) {
var d = unique(data.infoList)
// var colors = ["#31C563"]
var option62 = {
// color: colors,
tooltip: {
trigger: "axis",
axisPointer: {
type: "cross",
},
},
legend: {
top: "5%",
left: "center",
itemStyle: {
tooltip: true,
},
textStyle: {
fontSize: 16,
color: "#797979",
},
},
grid: {
left: 40,
bottom: 25,
},
xAxis: [{
type: "category",
axisTick: {
alignWithLabel: true,
},
axisLabel: {
fontSize: 16,
interval: 0,
},
data: d.map(function(item) {
return ningbo_allareas[item["areaCode"]]
}),
}, ],
yAxis: {
type: "value",
name: "套",
min: 0,
max: 5,
position: "left",
axisLine: {
show: true,
lineStyle: {
// color: colors[0],
},
},
axisTick: {
show: true,
},
splitLine: {
show: false,
},
axisLabel: {
formatter: "{value} 套",
fontSize: 16,
},
nameTextStyle: {
// color: "#31C563",
fontSize: 16,
},
},
series: [{
name: "各区县市完成值",
type: "bar",
barWidth: "30%",
data: d.map(function(item) {
return item["currentValue"]
}),
itemStyle: {
normal: {
color: "#31C563",
label: {
show: false, //显示文本
textStyle: {
color: "#000",
fontSize: "14",
},
},
},
},
}, ],
}
myChart62.setOption(option62)
})
/* 所有农村房屋排查录入率 */
var taskId1 = "235354627989651456"
var quotaCode1 = "Q236529416418709507"
var myChart63 = echarts.init(document.querySelector(".echart63"))
$.post("https://sznbs.ningbo.gov.cn:89/nbszhjkzz/tojcms/targetProgress.do?taskId=" + taskId1 + "&taskSystem=government&quotaCode=" + quotaCode1, function (data) {
// debugger;
var nb_value = data.infoList.filter(function (item) {
return item["areaName"] == "宁波市"
})[0]["quotaValue"]
var option63 = {
tooltip: {
trigger: "item",
show: true,
showContent: true,
},
// legend: {
// top: "5%",
// left: "center",
// itemStyle: {
// tooltip: true,
// },
// },
series: [{
// name: "Access From",
type: "pie",
radius: ["55%", "70%"],
avoidLabelOverlap: false,
label: {
show: true,
// position: "center",
},
itemStyle: {
color: "#3D9DF4",
},
emphasis: {
label: {
show: true,
fontSize: "40",
fontWeight: "bold",
},
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: "rgba(0, 0, 0, 0.5)",
},
},
labelLine: {
show: false,
},
data: [{
value: parseFloat(nb_value).toFixed(2),
name: parseFloat(nb_value).toFixed(2)+ "%",
label: {
position: "center",
fontSize: 18,
},},
{
value: 0,
// name: "43%",
itemStyle: {
color: "#EEEEEE",
},
label: {
position: "center",
fontSize: 16,
},
}, ],
}, ],
}
myChart63.setOption(option63)
})
/* 鉴定为C、D级用作生产经营自建房的整治改造率 */
var url99 = "https://sznbs.ningbo.gov.cn:89/nbszhjkzz/tojcms/targetProgress.do?taskId=235354627989651456&taskSystem=government&quotaCode=Q236532762860933123"
var myChart64 = echarts.init(document.querySelector(".echart64"))
$.post(url99,function(data){
var nb_value = data.infoList.filter(function (item) {
return item["areaName"] == "宁波市"
})[0]["quotaValue"]
var option64 = {
tooltip: {
trigger: "item",
show: true,
showContent: true,
},
// legend: {
// top: "5%",
// left: "center",
// itemStyle: {
// tooltip: true,
// },
// },
series: [{
// name: "Access From",
type: "pie",
radius: ["55%", "70%"],
avoidLabelOverlap: false,
label: {
show: true,
// position: "center",
},
itemStyle: {
color: "#3D9DF4",
},
emphasis: {
label: {
show: true,
fontSize: "40",
fontWeight: "bold",
},
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: "rgba(0, 0, 0, 0.5)",
},
},
labelLine: {
show: false,
},
data: [{
value: parseFloat(nb_value).toFixed(2),
name: parseFloat(nb_value).toFixed(2)+ "%",
label: {
position: "center",
fontSize: 18,
},
},
{
value: 0,
// name: "43%",
itemStyle: {
color: "#EEEEEE",
},
label: {
position: "center",
fontSize: 16,
},
},
],
}, ],
}
myChart64.setOption(option64)
})
var url100 = "https://sznbs.ningbo.gov.cn:89/nbszhjkzz/tojcms/targetProgress.do?taskId=235354627989651456&taskSystem=government&quotaCode=Q236530943887757315"
var myChart65 = echarts.init(document.querySelector(".echart65"))
$.post(url100,function(data){
var nb_value = data.infoList.filter(function (item) {
return item["areaName"] == "宁波市"
})[0]["quotaValue"]
var option65 = {
tooltip: {
trigger: "item",
show: true,
showContent: true,
},
// legend: {
// top: "5%",
// left: "center",
// itemStyle: {
// tooltip: true,
// },
// },
series: [{
// name: "Access From",
type: "pie",
radius: ["55%", "70%"],
avoidLabelOverlap: false,
label: {
show: true,
// position: "center",
},
itemStyle: {
color: "#3D9DF4",
},
emphasis: {
label: {
show: true,
fontSize: "40",
fontWeight: "bold",
},
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: "rgba(0, 0, 0, 0.5)",
},
},
labelLine: {
show: false,
},
data: [{
value: parseFloat(nb_value).toFixed(2),
name: parseFloat(nb_value).toFixed(2)+ "%",
label: {
position: "center",
fontSize: 18,
},
},
{
value: 0,
// name: "43%",
itemStyle: {
color: "#EEEEEE",
},
label: {
position: "center",
fontSize: 16,
},
},],
}, ],
}
myChart65.setOption(option65)
})