测试文件
This commit is contained in:
355
portal/h5/cunzhen/1.js
Normal file
355
portal/h5/cunzhen/1.js
Normal file
@@ -0,0 +1,355 @@
|
||||
|
||||
var myChart71 = echarts.init(document.querySelector(".echart71"))
|
||||
var myChart72 = echarts.init(document.querySelector(".echart72"))
|
||||
|
||||
$.post("https://sznbs.ningbo.gov.cn:89/nbszhjkzz/tojcms/getQuotaByTaksIdOrQuotaCode.do?parentQuotaCode=Q233995772651192323&systemName=government",function(data){
|
||||
var d = unique(data.infoList)
|
||||
var alls = countTotal(d,"targetValue")
|
||||
$("#wushuizong").html(alls)
|
||||
|
||||
var option71 = {
|
||||
tooltip: {
|
||||
trigger: "item",
|
||||
show: false,
|
||||
showContent: true,
|
||||
},
|
||||
|
||||
series: [{
|
||||
// name: "Access From",
|
||||
type: "pie",
|
||||
radius: ["70%", "90%"],
|
||||
avoidLabelOverlap: false,
|
||||
label: {
|
||||
show: true,
|
||||
// position: "center",
|
||||
},
|
||||
|
||||
labelLine: {
|
||||
show: false,
|
||||
},
|
||||
data: [{
|
||||
value: alls,
|
||||
name: "100%",
|
||||
label: {
|
||||
position: "center",
|
||||
fontSize: 18,
|
||||
color: "#FE6900",
|
||||
},
|
||||
itemStyle: {
|
||||
color: "#FE6900",
|
||||
},
|
||||
}, ],
|
||||
}, ],
|
||||
}
|
||||
myChart71.setOption(option71)
|
||||
|
||||
//污水改造柱状图
|
||||
|
||||
var option72 = {
|
||||
legend: {
|
||||
show: true,
|
||||
top: 5,
|
||||
textStyle: {
|
||||
fontSize: 16,
|
||||
color: "#797979",
|
||||
},
|
||||
},
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
axisPointer: {
|
||||
// 坐标轴指示器,坐标轴触发有效
|
||||
type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
|
||||
},
|
||||
formatter: "{b}" + "{a0}" + ": " + "{c0}",
|
||||
},
|
||||
|
||||
grid: {
|
||||
left: "3%",
|
||||
right: "0%",
|
||||
bottom: 20,
|
||||
top: "12%",
|
||||
containLabel: true,
|
||||
},
|
||||
yAxis: [{
|
||||
type: "value",
|
||||
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: "#D5D5DF",
|
||||
},
|
||||
},
|
||||
axisLabel: {
|
||||
show: true,
|
||||
formatter: "{value}",
|
||||
textStyle: {
|
||||
color: "#333",
|
||||
fontSize: 16,
|
||||
},
|
||||
},
|
||||
splitLine: {
|
||||
//网格线
|
||||
lineStyle: {
|
||||
type: "dashed", //设置网格线类型 dotted:虚线 solid:实线
|
||||
},
|
||||
show: false, //隐藏或显示
|
||||
},
|
||||
axisTick: { show: true }, //坐标轴刻度
|
||||
axisLine: { show: true }, //坐标轴轴线
|
||||
}, ],
|
||||
xAxis: {
|
||||
type: "category",
|
||||
axisTick: {
|
||||
show: true,
|
||||
alignWithLabel: true,
|
||||
},
|
||||
axisLabel: {
|
||||
interval: 0,
|
||||
margin: 13,
|
||||
fontSize: 16,
|
||||
color: "#333",
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: "#999",
|
||||
},
|
||||
},
|
||||
data: [
|
||||
"海曙区",
|
||||
"江北区",
|
||||
"北仑区",
|
||||
"镇海区",
|
||||
"鄞州区",
|
||||
"奉化区",
|
||||
"象山县",
|
||||
"宁海县",
|
||||
"余姚市",
|
||||
"慈溪市",
|
||||
"东钱湖",
|
||||
"杭州湾",
|
||||
],
|
||||
},
|
||||
series: [{
|
||||
name: "目标值",
|
||||
type: "bar",
|
||||
barWidth: 20, //柱图宽度
|
||||
color: "#76ddfb",
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: "#2690f2", //改变折线点的颜色
|
||||
lineStyle: {
|
||||
color: "#2690f2", //改变折线颜色
|
||||
},
|
||||
},
|
||||
},
|
||||
data: d.map(item=>{
|
||||
return item["targetValue"]
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "实际值",
|
||||
type: "bar",
|
||||
barWidth: 20, //柱图宽度
|
||||
color: "#76ddfb",
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: "#32c565", //改变折线点的颜色
|
||||
lineStyle: {
|
||||
color: "#32c565", //改变折线颜色
|
||||
},
|
||||
},
|
||||
},
|
||||
data: d.map(item=>{
|
||||
return item["currentValue"]
|
||||
}),
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
myChart72.setOption(option72)
|
||||
|
||||
})
|
||||
|
||||
var myChart73 = echarts.init(document.querySelector(".echart73"))
|
||||
var myChart74 = echarts.init(document.querySelector(".echart74"))
|
||||
|
||||
$.post("https://sznbs.ningbo.gov.cn:89/nbszhjkzz/tojcms/getQuotaByTaksIdOrQuotaCode.do?parentQuotaCode=Q233987370675945475&systemName=government",function(data){
|
||||
let d = unique(data.infoList)
|
||||
let alls = countTotal(d,"targetValue")
|
||||
$("#ywmub").html(alls)
|
||||
var option73 = {
|
||||
tooltip: {
|
||||
trigger: "item",
|
||||
show: false,
|
||||
showContent: true,
|
||||
},
|
||||
series: [{
|
||||
type: "pie",
|
||||
radius: ["70%", "90%"],
|
||||
avoidLabelOverlap: false,
|
||||
label: {
|
||||
show: true,
|
||||
// position: "center",
|
||||
},
|
||||
|
||||
labelLine: {
|
||||
show: false,
|
||||
},
|
||||
data: [{
|
||||
value: alls,
|
||||
name: alls/alls*100 + "%",
|
||||
label: {
|
||||
position: "center",
|
||||
fontSize: 18,
|
||||
color: "#31C463",
|
||||
},
|
||||
itemStyle: {
|
||||
color: "#31C463",
|
||||
},
|
||||
},
|
||||
/* {
|
||||
value: 36,
|
||||
name: "36%",
|
||||
itemStyle: {
|
||||
color: "#EFEFEF",
|
||||
},
|
||||
label: {
|
||||
show: false,
|
||||
},
|
||||
}, */
|
||||
],
|
||||
}, ],
|
||||
}
|
||||
myChart73.setOption(option73)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var option74 = {
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
axisPointer: {
|
||||
// 坐标轴指示器,坐标轴触发有效
|
||||
type: "shadow", // 默认为直线,可选为:'line' | 'shadow'
|
||||
},
|
||||
formatter: "{b}" + "{a1}" + ": " + "{c0}",
|
||||
},
|
||||
legend: {
|
||||
show: true,
|
||||
textStyle: {
|
||||
fontSize: 16,
|
||||
color: "#797979",
|
||||
},
|
||||
top: 5,
|
||||
|
||||
// left: "left",
|
||||
},
|
||||
|
||||
grid: {
|
||||
left: "3%",
|
||||
right: "0%",
|
||||
bottom: 20,
|
||||
top: "12%",
|
||||
containLabel: true,
|
||||
},
|
||||
yAxis: [{
|
||||
type: "value",
|
||||
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: "#D5D5DF",
|
||||
},
|
||||
},
|
||||
axisLabel: {
|
||||
show: true,
|
||||
formatter: "{value}",
|
||||
textStyle: {
|
||||
color: "#333",
|
||||
fontSize: 16,
|
||||
},
|
||||
},
|
||||
splitLine: {
|
||||
//网格线
|
||||
lineStyle: {
|
||||
type: "dashed", //设置网格线类型 dotted:虚线 solid:实线
|
||||
},
|
||||
show: false, //隐藏或显示
|
||||
},
|
||||
axisTick: { show: true }, //坐标轴刻度
|
||||
axisLine: { show: true }, //坐标轴轴线
|
||||
}, ],
|
||||
xAxis: {
|
||||
type: "category",
|
||||
axisTick: {
|
||||
show: true,
|
||||
alignWithLabel: true,
|
||||
},
|
||||
axisLabel: {
|
||||
interval: 0,
|
||||
margin: 13,
|
||||
fontSize: 16,
|
||||
color: "#333",
|
||||
},
|
||||
axisLine: {
|
||||
lineStyle: {
|
||||
color: "#999",
|
||||
},
|
||||
},
|
||||
data: [
|
||||
"海曙区",
|
||||
"江北区",
|
||||
"北仑区",
|
||||
"镇海区",
|
||||
"鄞州区",
|
||||
"奉化区",
|
||||
"象山县",
|
||||
"宁海县",
|
||||
"余姚市",
|
||||
"慈溪市",
|
||||
],
|
||||
},
|
||||
series: [{
|
||||
name: "实际值",
|
||||
type: "bar",
|
||||
stack: true,
|
||||
barWidth: 20, //柱图宽度
|
||||
color: "#76ddfb",
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: "#2690f2", //改变折线点的颜色
|
||||
lineStyle: {
|
||||
color: "#2690f2", //改变折线颜色
|
||||
},
|
||||
},
|
||||
},
|
||||
data: d.map(item=>{
|
||||
return item["targetValue"]
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: "目标值",
|
||||
type: "bar",
|
||||
barWidth: 20, //柱图宽度
|
||||
color: "#76ddfb",
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: "#32c565", //改变折线点的颜色
|
||||
lineStyle: {
|
||||
color: "#32c565", //改变折线颜色
|
||||
},
|
||||
},
|
||||
},
|
||||
stack: true,
|
||||
data: d.map(item=>{
|
||||
return item["currentValue"]
|
||||
}),
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
myChart74.setOption(option74)
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user