diff --git a/img/dataAnalysisOctober/acceptanceItemsRate.png b/img/dataAnalysisOctober/acceptanceItemsRate.png new file mode 100644 index 0000000..8615f57 Binary files /dev/null and b/img/dataAnalysisOctober/acceptanceItemsRate.png differ diff --git a/img/dataAnalysisOctober/acceptedItemsRate.png b/img/dataAnalysisOctober/acceptedItemsRate.png new file mode 100644 index 0000000..218b836 Binary files /dev/null and b/img/dataAnalysisOctober/acceptedItemsRate.png differ diff --git a/img/dataAnalysisOctober/accountTerminatedRisk.png b/img/dataAnalysisOctober/accountTerminatedRisk.png new file mode 100644 index 0000000..040b942 Binary files /dev/null and b/img/dataAnalysisOctober/accountTerminatedRisk.png differ diff --git a/img/dataAnalysisOctober/builder.png b/img/dataAnalysisOctober/builder.png new file mode 100644 index 0000000..332233b Binary files /dev/null and b/img/dataAnalysisOctober/builder.png differ diff --git a/img/dataAnalysisOctober/cost.png b/img/dataAnalysisOctober/cost.png new file mode 100644 index 0000000..faaf235 Binary files /dev/null and b/img/dataAnalysisOctober/cost.png differ diff --git a/img/dataAnalysisOctober/environmentalAnalysis.png b/img/dataAnalysisOctober/environmentalAnalysis.png new file mode 100644 index 0000000..fc2db41 Binary files /dev/null and b/img/dataAnalysisOctober/environmentalAnalysis.png differ diff --git a/img/dataAnalysisOctober/factor.png b/img/dataAnalysisOctober/factor.png new file mode 100644 index 0000000..72dc033 Binary files /dev/null and b/img/dataAnalysisOctober/factor.png differ diff --git a/img/dataAnalysisOctober/firstRate.png b/img/dataAnalysisOctober/firstRate.png new file mode 100644 index 0000000..9a89519 Binary files /dev/null and b/img/dataAnalysisOctober/firstRate.png differ diff --git a/img/dataAnalysisOctober/progress.png b/img/dataAnalysisOctober/progress.png new file mode 100644 index 0000000..8e26a77 Binary files /dev/null and b/img/dataAnalysisOctober/progress.png differ diff --git a/img/dataAnalysisOctober/projectCost.png b/img/dataAnalysisOctober/projectCost.png new file mode 100644 index 0000000..b696f62 Binary files /dev/null and b/img/dataAnalysisOctober/projectCost.png differ diff --git a/img/dataAnalysisOctober/projectRisk.png b/img/dataAnalysisOctober/projectRisk.png new file mode 100644 index 0000000..9cfdaa5 Binary files /dev/null and b/img/dataAnalysisOctober/projectRisk.png differ diff --git a/img/dataAnalysisOctober/qualityAnalysis.png b/img/dataAnalysisOctober/qualityAnalysis.png new file mode 100644 index 0000000..cfbe7c0 Binary files /dev/null and b/img/dataAnalysisOctober/qualityAnalysis.png differ diff --git a/img/dataAnalysisOctober/risk.png b/img/dataAnalysisOctober/risk.png new file mode 100644 index 0000000..e37078a Binary files /dev/null and b/img/dataAnalysisOctober/risk.png differ diff --git a/img/dataAnalysisOctober/safety.png b/img/dataAnalysisOctober/safety.png new file mode 100644 index 0000000..ba51269 Binary files /dev/null and b/img/dataAnalysisOctober/safety.png differ diff --git a/img/dataAnalysisOctober/safetyAlert.png b/img/dataAnalysisOctober/safetyAlert.png new file mode 100644 index 0000000..0387653 Binary files /dev/null and b/img/dataAnalysisOctober/safetyAlert.png differ diff --git a/img/dataAnalysisOctober/totalRate.png b/img/dataAnalysisOctober/totalRate.png new file mode 100644 index 0000000..c1bb054 Binary files /dev/null and b/img/dataAnalysisOctober/totalRate.png differ diff --git a/js/pages/dataAnalysisOctober/overallEfficiency.js b/js/pages/dataAnalysisOctober/overallEfficiency.js new file mode 100644 index 0000000..c4c79c0 --- /dev/null +++ b/js/pages/dataAnalysisOctober/overallEfficiency.js @@ -0,0 +1,322 @@ +let table, layer, form; +let fontSize = '14', fontFamily = 'Alibaba PuHuiTi R', fontColor = '#fff'; + +layui.use(["layer", "table", "form"], function () { + layer = layui.layer; + table = layui.table; + form = layui.form; + + getEnvironmental(); + + getSafetyAlert(); +}); + +function getEnvironmental() { + let yList = [32, 58, 64, 164, 99]; + let xData = ['学前', '小学', '初中', '高中', 'qq']; + initEnvironmental(yList, xData) +} + +function initEnvironmental(yList, xData) { + let barWidth = 60; + let colors = [] + for (let i = 0; i < xData.length; i++) { + colors.push({ + type: 'linear', + x: 0, + x2: 1, + y: 0, + y2: 0, + colorStops: [ + { + offset: 0, + color: '#1CFFF4' // 最左边 + }, { + offset: 0.5, + color: '#1CFFF4' // 左边的右边 颜色 + }, { + offset: 0.5, + color: '#1CFFF4' // 右边的左边 颜色 + }, { + offset: 1, + color: '#1CFFF4' + }] + }) + } + const myChart = echarts.init(document.getElementById("environmental")); + const option = { + //提示框 + tooltip: { + trigger: 'axis', + formatter: "{b} : {c}", + axisPointer: { // 坐标轴指示器,坐标轴触发有效 + type: 'shadow' // 默认为直线,可选为:'line' | 'shadow' + } + }, + /**区域位置*/ + grid: { + left: '8%', + right: '3%', + top: '30%', + bottom: '30%', + }, + //X轴 + xAxis: { + data: xData, + type: 'category', + axisLine: { + show: false, + lineStyle: { + color: 'rgba(255,255,255,1)', + shadowColor: 'rgba(255,255,255,1)', + shadowOffsetX: '20', + }, + symbol: ['none', 'arrow'], + symbolOffset: [0, 25] + }, + splitLine: { + show: false, + }, + axisTick: { + show: false + }, + axisLabel: { + margin: 30, + fontSize: 15, + }, + }, + yAxis: { + show: true, + splitNumber: 4, + axisLine: { + show: false, + }, + splitLine: { + show: true, + lineStyle: { + type: 'dashed', + color: '#075858' + }, + }, + axisLabel: { + color: '#FFFFFF', + margin: 8, + fontSize: 15 + } + }, + series: [ + { + type: 'bar', + barWidth: barWidth, + itemStyle: { + normal: { + color: function (params) { + return colors[params.dataIndex % 7]; + } + } + }, + label: { + show: false, + position: [barWidth / 2, -(barWidth + 20)], + color: '#ffffff', + fontSize: 14, + fontStyle: 'bold', + align: 'center', + }, + data: yList + }, + { + z: 2, + type: 'pictorialBar', + data: yList, + symbol: 'diamond', + symbolOffset: [0, '50%'], + symbolSize: [barWidth, barWidth * 0.5], + itemStyle: { + normal: { + color: function (params) { + return colors[params.dataIndex % 7]; + }, + } + }, + }, + { + z: 3, + type: 'pictorialBar', + symbolPosition: 'end', + data: yList, + symbol: 'diamond', + symbolOffset: [0, '-50%'], + symbolSize: [barWidth, barWidth * 0.5], + itemStyle: { + normal: { + borderWidth: 0, + color: function (params) { + return colors[params.dataIndex % 7].colorStops[0].color; + }, + + } + }, + }, + ], + } + myChart.setOption(option); + window.addEventListener("resize", function () { + myChart.resize(); + }); +} + +function getSafetyAlert() { + let yList = [32, 58, 64, 164, 99]; + let xData = ['学前', '小学', '初中', '高中', 'qq']; + initSafetyAlert(yList, xData) +} + +function initSafetyAlert(yList, xData) { + let barWidth = 60; + let colors = [] + for (let i = 0; i < xData.length; i++) { + colors.push({ + type: 'linear', + x: 0, + x2: 1, + y: 0, + y2: 0, + colorStops: [ + { + offset: 0, + color: '#1CFFF4' // 最左边 + }, { + offset: 0.5, + color: '#1CFFF4' // 左边的右边 颜色 + }, { + offset: 0.5, + color: '#1CFFF4' // 右边的左边 颜色 + }, { + offset: 1, + color: '#1CFFF4' + }] + }) + } + const myChart = echarts.init(document.getElementById("safetyAlert")); + const option = { + //提示框 + tooltip: { + trigger: 'axis', + formatter: "{b} : {c}", + axisPointer: { // 坐标轴指示器,坐标轴触发有效 + type: 'shadow' // 默认为直线,可选为:'line' | 'shadow' + } + }, + /**区域位置*/ + grid: { + left: '8%', + right: '3%', + top: '30%', + bottom: '30%', + }, + //X轴 + xAxis: { + data: xData, + type: 'category', + axisLine: { + show: false, + lineStyle: { + color: 'rgba(255,255,255,1)', + shadowColor: 'rgba(255,255,255,1)', + shadowOffsetX: '20', + }, + symbol: ['none', 'arrow'], + symbolOffset: [0, 25] + }, + splitLine: { + show: false, + }, + axisTick: { + show: false + }, + axisLabel: { + margin: 30, + fontSize: 15, + }, + }, + yAxis: { + show: true, + splitNumber: 4, + axisLine: { + show: false, + }, + splitLine: { + show: true, + lineStyle: { + type: 'dashed', + color: '#075858' + }, + }, + axisLabel: { + color: '#FFFFFF', + margin: 8, + fontSize: 15 + } + }, + series: [ + { + type: 'bar', + barWidth: barWidth, + itemStyle: { + normal: { + color: function (params) { + return colors[params.dataIndex % 7]; + } + } + }, + label: { + show: false, + position: [barWidth / 2, -(barWidth + 20)], + color: '#ffffff', + fontSize: 14, + fontStyle: 'bold', + align: 'center', + }, + data: yList + }, + { + z: 2, + type: 'pictorialBar', + data: yList, + symbol: 'diamond', + symbolOffset: [0, '50%'], + symbolSize: [barWidth, barWidth * 0.5], + itemStyle: { + normal: { + color: function (params) { + return colors[params.dataIndex % 7]; + }, + } + }, + }, + { + z: 3, + type: 'pictorialBar', + symbolPosition: 'end', + data: yList, + symbol: 'diamond', + symbolOffset: [0, '-50%'], + symbolSize: [barWidth, barWidth * 0.5], + itemStyle: { + normal: { + borderWidth: 0, + color: function (params) { + return colors[params.dataIndex % 7].colorStops[0].color; + }, + + } + }, + }, + ], + } + myChart.setOption(option); + window.addEventListener("resize", function () { + myChart.resize(); + }); +} diff --git a/js/pages/dataAnalysisOctober/projectManagement.js b/js/pages/dataAnalysisOctober/projectManagement.js new file mode 100644 index 0000000..be38143 --- /dev/null +++ b/js/pages/dataAnalysisOctober/projectManagement.js @@ -0,0 +1,972 @@ +let table, layer, form; +let fontSize = '14', fontFamily = 'Alibaba PuHuiTi R', fontColor = '#fff'; + +layui.use(["layer", "table", "form"], function () { + layer = layui.layer; + table = layui.table; + form = layui.form; + + getProjectProgress(); + + getProjectCost(); + + getPprojectRisk(); + + //土建专业 + getCivilEngineering(); + + //电气专业 + getElectrical(); + + //项目成本 + getItemCost(); + + //总风险数量 + getTotalRisk(); +}); + +function getProjectProgress() { + initProjectProgress() +} + +function initProjectProgress() { + const myChart = echarts.init(document.getElementById("projectProgress")); + const option = { + title: { + text: '当前工程进度', + left: '48%', + top: '30%', + textStyle: { + color: '#fff', + fontSize: 15, + fontWeight: 'normal', + } + }, + graphic: { + type: 'text', + left: '50%', + top: '50%', + style: { + text: '70%', + textAlign: 'center', + fill: '#79FFFF', + fontSize: 24, + } + }, + series: [ + { + type: 'pie', + radius: ['25%', '50%'], + center: ['30%', '50%'], + startAngle: 90, + hoverAnimation: false, + label: { + show: false + }, + labelLine: { + show: false + }, + data: [ + { + value: 70, + itemStyle: { + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ + offset: 0, + color: "#3BE6E6" + }, + { + offset: 1, + color: "#FFFFFF" + } + ], false), + } + }, + { + value: 30, + itemStyle: { + color: 'rgba(8, 220, 224, 0.1)' + } + } + ] + } + ] + }; + myChart.setOption(option); + window.addEventListener("resize", function () { + myChart.resize(); + }); +} + +function getProjectCost() { + initProjectCost(); +} + +function initProjectCost() { + const myChart = echarts.init(document.getElementById("projectCost")); + const option = { + title: { + text: '当前成本投入', + left: '48%', + top: '30%', + textStyle: { + color: '#fff', + fontSize: 15, + fontWeight: 'normal', + } + }, + graphic: { + type: 'text', + left: '50%', + top: '50%', + style: { + text: '70%', + textAlign: 'center', + fill: '#79FFFF', + fontSize: 24, + } + }, + series: [ + { + type: 'pie', + radius: ['25%', '50%'], + center: ['30%', '50%'], + startAngle: 90, + hoverAnimation: false, + label: { + show: false + }, + labelLine: { + show: false + }, + data: [ + { + value: 70, + itemStyle: { + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ + offset: 0, + color: "#3BE6E6" + }, + { + offset: 1, + color: "#FFFFFF" + } + ], false), + } + }, + { + value: 30, + itemStyle: { + color: 'rgba(8, 220, 224, 0.1)' + } + } + ] + } + ] + }; + myChart.setOption(option); + window.addEventListener("resize", function () { + myChart.resize(); + }); +} + +function getPprojectRisk() { + initProjectRisk(); +} + +function initProjectRisk() { + const myChart = echarts.init(document.getElementById("projectRisk")); + const option = { + tooltip: { + trigger: "item", + formatter: "{b}: {c}kWh ({d}%)", + backgroundColor: "rgba(0, 0, 0, 0.8)", + borderColor: "#08DCE0", + borderWidth: 1, + textStyle: { + color: "#fff", + }, + }, + legend: { + orient: "vertical", + right: "10%", + itemGap: 12, + itemWidth: 20, + itemHeight: 8, + textStyle: { + color: "#fff", + fontSize: 14, + rich: { + name: { + width: 80, + color: "#fff", + }, + value: { + width: 60, + align: "right", + color: "#79FFFF", + fontSize: 16, + fontWeight: "bold", + }, + }, + }, + formatter: (name) => { + const data = option.series[0].data + const item = data.find((d) => d.name === name) + const percent = item ? item.value : 0 + return `{name|${name}} {value|${percent}%}` + }, + }, + series: [ + { + name: "用电统计", + type: "pie", + roseType: "radius", + radius: [0, '70%'], + center: ["25%", "45%"], + avoidLabelOverlap: false, + itemStyle: { + borderRadius: 5, + borderColor: "rgba(0, 0, 0, 0.3)", + borderWidth: 2, + shadowBlur: 10, + shadowColor: "rgba(0, 0, 0, 0.5)", + }, + label: { + show: false, + }, + emphasis: { + label: { + show: false, + }, + itemStyle: { + shadowBlur: 20, + shadowOffsetX: 0, + shadowColor: "rgba(8, 220, 224, 0.8)", + }, + }, + labelLine: { + show: false, + }, + data: [ + { + value: 60, + name: "二级风险", + itemStyle: { + color: '#75F7EC', + }, + }, + { + value: 60, + name: "三级风险", + itemStyle: { + color: '#75F791', + }, + }, + { + value: 26, + name: "四级风险", + itemStyle: { + color: '#00C3F2', + }, + }, + { + value: 14, + name: "五级风险", + itemStyle: { + color: '#EB846A', + }, + }, + ], + }, + ], + }; + myChart.setOption(option); + window.addEventListener("resize", function () { + myChart.resize(); + }); +} + +function getCivilEngineering() { + let xLabel = ['xxxx-xx-01', 'xxxx-xx-02', 'xxxx-xx-03', 'xxxx-xx-04', 'xxxx-xx-05', 'xxxx-xx-06','xxxx-xx-07', 'xxxx-xx-08', 'xxxx-xx-09', 'xxxx-xx-10', 'xxxx-xx-11', 'xxxx-xx-12',] + let expenditureData = ["12", "15", "4", "8", "13", "6","10", "11", "5", "12","10", "15"] + let incomeData = ["4", "5", "5", "5", "5", "4","3", "5", "3","16", "5", "18"] + initCivilEngineering( xLabel,expenditureData,incomeData); +} + +function initCivilEngineering( xLabel,expenditureData,incomeData) { + + const leftChart = echarts.init(document.getElementById("civilEngineering")); + const option = { + title: { + text: '土建专业', + textStyle: { + color: '#ffffff', + fontSize: fontSize, + fontFamily: fontFamily + }, + left: 5, + top: 5 + }, + tooltip: { + show:true, + trigger: 'axis', + axisPointer: { + type: 'shadow', + }, + borderColor: 'rgba(255,255,255,.3)', + backgroundColor: 'rgba(19,51,55,.6)', + textStyle: { + color: 'white', //设置文字颜色 + }, + borderWidth: 1, + padding: 10, + }, + legend: { + show:true, + top:'5%', + right:'4%', + textStyle:{ + color:'#ffffff' + } + }, + grid: { + top: '25%', + left: '6%', + right: '4%', + bottom: '20%' + }, + xAxis: [ + { + type: 'category', + boundaryGap: true, + axisLine: { + //坐标轴轴线相关设置。数学上的x轴 + show: true, + lineStyle: { + color: '#5A6E71', + }, + }, + axisLabel: { + //坐标轴刻度标签的相关设置 + textStyle: { + color: fontColor, + fontSize: fontSize, + fontFamily: fontFamily + }, + }, + splitLine: { + show: false, + lineStyle: { + color: '#233653', + }, + }, + axisTick: { + show: true, + }, + data: xLabel, + }, + ], + yAxis: [{ + min: 0, + splitNumber: 10, + splitLine: { + show: true, + lineStyle: { + color: 'rgba(255,255,255,0.6)', + type: 'dashed', + }, + }, + axisLine: { + show: false, + }, + axisLabel: { + show: true, + textStyle: { + color: 'rgba(255,255,255,0.8)', + padding: 16 + }, + formatter: function(value) { + if (value === 0) { + return value + } + return value + } + }, + axisTick: { + show: false, + }, + }], + series: [{ + name: '计划', + type: 'line', + symbol: 'circle', + showAllSymbol: true, + symbolSize: 0, + smooth: true, + lineStyle: { + normal: { + width: 2, + color: "#00FEFC", + } + }, + itemStyle: { + color: "#00FEFC", + borderWidth: 2 + }, + tooltip: { + show: true + }, + areaStyle: { + normal: { + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ + offset: 0, + color: "rgba(18,86,100,0.6)" + }, + { + offset: 1, + color: "rgba(16,72,81, 0.7)" + } + ], false), + shadowColor: 'rgba(15,55,63, 0.8)', + shadowBlur: 20 + } + }, + data: expenditureData + }, { + name: '实现', + type: 'line', + symbol: 'circle', + showAllSymbol: true, + symbolSize: 0, + smooth: true, + lineStyle: { + normal: { + width: 2, + color: "rgba(25,196,134, 1)", + } + }, + itemStyle: { + color: "rgba(25,196,134, 1)", + borderWidth: 2 + + }, + tooltip: { + show: true + }, + areaStyle: { + normal: { + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ + offset: 0, + color: "rgba(17,95,82, 0.6)" + }, + { + offset: 1, + color: "rgba(16,72,67, 0.7)" + } + ], false), + shadowColor: 'rgba(15,55,54, 0.8)', + shadowBlur: 20 + } + }, + data: incomeData + }] + }; + + leftChart.setOption(option); + // 响应式调整 + window.addEventListener("resize", function () { + leftChart.resize(); + }); +} + +function getElectrical() { + let xLabel = ['xxxx-xx-01', 'xxxx-xx-02', 'xxxx-xx-03', 'xxxx-xx-04', 'xxxx-xx-05', 'xxxx-xx-06','xxxx-xx-07', 'xxxx-xx-08', 'xxxx-xx-09', 'xxxx-xx-10', 'xxxx-xx-11', 'xxxx-xx-12',] + let expenditureData = ["12", "15", "4", "8", "13", "6","10", "11", "5", "12","10", "15"] + let incomeData = ["4", "5", "5", "5", "5", "4","3", "5", "3","16", "5", "18"] + initElectrical( xLabel,expenditureData,incomeData); +} + +function initElectrical( xLabel,expenditureData,incomeData) { + const leftChart = echarts.init(document.getElementById("electrical")); + const option = { + title: { + text: '电气专业', + textStyle: { + color: '#ffffff', + fontSize: fontSize, + fontFamily: fontFamily + }, + left: 5, + top: 5 + }, + tooltip: { + show:true, + trigger: 'axis', + axisPointer: { + type: 'shadow', + }, + borderColor: 'rgba(255,255,255,.3)', + backgroundColor: 'rgba(19,51,55,.6)', + textStyle: { + color: 'white', //设置文字颜色 + }, + borderWidth: 1, + padding: 10, + }, + legend: { + show:true, + top:'5%', + right:'4%', + textStyle:{ + color:'#ffffff' + } + }, + grid: { + top: '25%', + left: '6%', + right: '4%', + bottom: '20%' + }, + xAxis: [ + { + type: 'category', + boundaryGap: true, + axisLine: { + //坐标轴轴线相关设置。数学上的x轴 + show: true, + lineStyle: { + color: '#5A6E71', + }, + }, + axisLabel: { + //坐标轴刻度标签的相关设置 + textStyle: { + color: fontColor, + fontSize: fontSize, + fontFamily: fontFamily + }, + }, + splitLine: { + show: false, + lineStyle: { + color: '#233653', + }, + }, + axisTick: { + show: true, + }, + data: xLabel, + }, + ], + yAxis: [{ + min: 0, + splitNumber: 10, + splitLine: { + show: true, + lineStyle: { + color: 'rgba(255,255,255,0.6)', + type: 'dashed', + }, + }, + axisLine: { + show: false, + }, + axisLabel: { + show: true, + textStyle: { + color: 'rgba(255,255,255,0.8)', + padding: 16 + }, + formatter: function(value) { + if (value === 0) { + return value + } + return value + } + }, + axisTick: { + show: false, + }, + }], + series: [{ + name: '计划', + type: 'line', + symbol: 'circle', + showAllSymbol: true, + symbolSize: 0, + smooth: true, + lineStyle: { + normal: { + width: 2, + color: "#00FEFC", + } + }, + itemStyle: { + color: "#00FEFC", + borderWidth: 2 + }, + tooltip: { + show: true + }, + areaStyle: { + normal: { + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ + offset: 0, + color: "rgba(18,86,100,0.6)" + }, + { + offset: 1, + color: "rgba(16,72,81, 0.7)" + } + ], false), + shadowColor: 'rgba(15,55,63, 0.8)', + shadowBlur: 20 + } + }, + data: expenditureData + }, { + name: '实现', + type: 'line', + symbol: 'circle', + showAllSymbol: true, + symbolSize: 0, + smooth: true, + lineStyle: { + normal: { + width: 2, + color: "rgba(25,196,134, 1)", + } + }, + itemStyle: { + color: "rgba(25,196,134, 1)", + borderWidth: 2 + + }, + tooltip: { + show: true + }, + areaStyle: { + normal: { + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ + offset: 0, + color: "rgba(17,95,82, 0.6)" + }, + { + offset: 1, + color: "rgba(16,72,67, 0.7)" + } + ], false), + shadowColor: 'rgba(15,55,54, 0.8)', + shadowBlur: 20 + } + }, + data: incomeData + }] + }; + + leftChart.setOption(option); + // 响应式调整 + window.addEventListener("resize", function () { + leftChart.resize(); + }); +} + +function getItemCost(){ + let xLabel = ['xxxx-xx-01', 'xxxx-xx-02', 'xxxx-xx-03', 'xxxx-xx-04', 'xxxx-xx-05', 'xxxx-xx-06','xxxx-xx-07', 'xxxx-xx-08', 'xxxx-xx-09', 'xxxx-xx-10', 'xxxx-xx-11', 'xxxx-xx-12',] + let expenditureData = ["12", "15", "4", "8", "13", "6","10", "11", "5", "12","10", "15"] + let incomeData = ["4", "5", "5", "5", "5", "4","3", "5", "3","16", "5", "18"] + initItemCost(xLabel,expenditureData,incomeData) +} + +function initItemCost(xLabel,expenditureData,incomeData){ + const leftChart = echarts.init(document.getElementById("itemCost")); + const option = { + tooltip: { + show:true, + trigger: 'axis', + axisPointer: { + type: 'shadow', + }, + borderColor: 'rgba(255,255,255,.3)', + backgroundColor: 'rgba(19,51,55,.6)', + textStyle: { + color: 'white', //设置文字颜色 + }, + borderWidth: 1, + padding: 10, + }, + legend: { + show:true, + top:'15%', + right:'4%', + textStyle:{ + color:'#ffffff' + } + }, + grid: { + top: '30%', + left: '5%', + right: '4%', + bottom: '20%' + }, + xAxis: [ + { + type: 'category', + boundaryGap: true, + axisLine: { + //坐标轴轴线相关设置。数学上的x轴 + show: true, + lineStyle: { + color: '#5A6E71', + }, + }, + axisLabel: { + //坐标轴刻度标签的相关设置 + textStyle: { + color: fontColor, + fontSize: fontSize, + fontFamily: fontFamily + }, + }, + splitLine: { + show: false, + lineStyle: { + color: '#233653', + }, + }, + axisTick: { + show: true, + }, + data: xLabel, + }, + ], + yAxis: [{ + min: 0, + splitNumber: 10, + splitLine: { + show: true, + lineStyle: { + color: 'rgba(255,255,255,0.6)', + type: 'dashed', + }, + }, + axisLine: { + show: false, + }, + axisLabel: { + show: true, + textStyle: { + color: 'rgba(255,255,255,0.8)', + padding: 16 + }, + formatter: function(value) { + if (value === 0) { + return value + } + return value + } + }, + axisTick: { + show: false, + }, + }], + series: [{ + name: '计划', + type: 'line', + symbol: 'circle', + showAllSymbol: true, + symbolSize: 0, + smooth: true, + lineStyle: { + normal: { + width: 2, + color: "#00FEFC", + } + }, + itemStyle: { + color: "#00FEFC", + borderWidth: 2 + }, + tooltip: { + show: true + }, + areaStyle: { + normal: { + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ + offset: 0, + color: "rgba(18,86,100,0.6)" + }, + { + offset: 1, + color: "rgba(16,72,81, 0.7)" + } + ], false), + shadowColor: 'rgba(15,55,63, 0.8)', + shadowBlur: 20 + } + }, + data: expenditureData + }, { + name: '实现', + type: 'line', + symbol: 'circle', + showAllSymbol: true, + symbolSize: 0, + smooth: true, + lineStyle: { + normal: { + width: 2, + color: "rgba(25,196,134, 1)", + } + }, + itemStyle: { + color: "rgba(25,196,134, 1)", + borderWidth: 2 + + }, + tooltip: { + show: true + }, + areaStyle: { + normal: { + color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ + offset: 0, + color: "rgba(17,95,82, 0.6)" + }, + { + offset: 1, + color: "rgba(16,72,67, 0.7)" + } + ], false), + shadowColor: 'rgba(15,55,54, 0.8)', + shadowBlur: 20 + } + }, + data: incomeData + }] + }; + + leftChart.setOption(option); + // 响应式调整 + window.addEventListener("resize", function () { + leftChart.resize(); + }); +} + +function getTotalRisk(){ + initTotalRisk() +} + +function initTotalRisk(){ + const myChart = echarts.init(document.getElementById("totalRisk")); + const option = { + tooltip: { + trigger: "item", + formatter: "{b}: {c}kWh ({d}%)", + backgroundColor: "rgba(0, 0, 0, 0.8)", + borderColor: "#08DCE0", + borderWidth: 1, + textStyle: { + color: "#fff", + }, + }, + legend: { + orient: "vertical", + right: "5%", + top: "15%", + itemGap: 22, + itemWidth: 20, + itemHeight: 8, + textStyle: { + color: "#fff", + fontSize: 14, + rich: { + name: { + width: 60, + color: "#fff", + }, + value: { + width: 60, + align: "right", + color: "#79FFFF", + fontSize: 16, + fontWeight: "bold", + }, + }, + }, + formatter: (name) => { + const data = option.series[0].data + const item = data.find((d) => d.name === name) + const percent = item ? item.value : 0 + return `{name|${name}} {value|${percent}%}` + }, + }, + series: [ + { + name: "用电统计", + type: "pie", + roseType: "radius", + radius: [0, '70%'], + center: ["15%", "45%"], + avoidLabelOverlap: false, + itemStyle: { + borderRadius: 5, + borderColor: "rgba(0, 0, 0, 0.3)", + borderWidth: 2, + shadowBlur: 10, + shadowColor: "rgba(0, 0, 0, 0.5)", + }, + label: { + show: false, + }, + emphasis: { + label: { + show: false, + }, + itemStyle: { + shadowBlur: 20, + shadowOffsetX: 0, + shadowColor: "rgba(8, 220, 224, 0.8)", + }, + }, + labelLine: { + show: false, + }, + data: [ + { + value: 60, + name: "二级风险", + itemStyle: { + color: '#75F7EC', + }, + }, + { + value: 60, + name: "三级风险", + itemStyle: { + color: '#75F791', + }, + }, + { + value: 26, + name: "四级风险", + itemStyle: { + color: '#00C3F2', + }, + }, + { + value: 14, + name: "五级风险", + itemStyle: { + color: '#EB846A', + }, + }, + ], + }, + ], + }; + myChart.setOption(option); + window.addEventListener("resize", function () { + myChart.resize(); + }); +} diff --git a/pages/dataAnalysisOctober/engineeringSafetyAnalysis.html b/pages/dataAnalysisOctober/engineeringSafetyAnalysis.html index 8ade3cd..df607f4 100644 --- a/pages/dataAnalysisOctober/engineeringSafetyAnalysis.html +++ b/pages/dataAnalysisOctober/engineeringSafetyAnalysis.html @@ -165,7 +165,7 @@