From eb20bb74e68c8ccc815a5fa2d556e19c8b407af3 Mon Sep 17 00:00:00 2001
From: whyczyk <525500596@qq.com>
Date: 星期一, 11 十月 2021 15:11:26 +0800
Subject: [PATCH] 问题修复

---
 src/assets/js/charts/persons/wangxuan.js   |   28 ++++----------
 src/components/charts/MonCap.vue           |   13 ++----
 src/components/charts/RoseChart.vue        |    4 +-
 src/components/charts/dischargeCircuit.vue |    1 
 src/components/charts/monomerVoltage.vue   |   55 ++++++++++-----------------
 5 files changed, 35 insertions(+), 66 deletions(-)

diff --git a/src/assets/js/charts/persons/wangxuan.js b/src/assets/js/charts/persons/wangxuan.js
index 274424c..c967770 100644
--- a/src/assets/js/charts/persons/wangxuan.js
+++ b/src/assets/js/charts/persons/wangxuan.js
@@ -29,31 +29,19 @@
         y: 0.35,
         type: 'monomerVoltage',
         setData: {
-            legendData: ['鍗曚綋鐢靛帇', '鍗曚綋鍐呴樆', '鍗曚綋娓╁害'],
             yAxisData: ['鍗曚綋鐢靛帇楂樺憡璀�', '鍗曚綋鐢靛帇浣庡憡璀�', '鍗曚綋鍐呴樆楂樺憡璀�', '鍗曚綋鍐呴樆浣庡憡璀�', '鍗曚綋娓╁害楂樺憡璀�', '鍗曚綋鍐呴樆浣庡憡璀�'],
             data: [{
-                name: '鍗曚綋鐢靛帇',
+                name: '鍛婅鏁�',
                 type: 'bar',
                 data: [24, 18, 38, 31, 24, 13],
                 itemStyle: {
-                    color: '#FED601'
-                }
-            },
-            {
-                name: '鍗曚綋鍐呴樆',
-                type: 'bar',
-                data: [19, 28, 46, 24, 14, 9],
-                itemStyle: {
-                    color: '#67E0E3'
-                }
-            },
-            {
-                name: '鍗曚綋娓╁害',
-                type: 'bar',
-                data: [15, 22, 36, 15, 21, 8],
-                itemStyle: {
-                    color: '#EB6F49'
-                }
+                    normal: {
+                        color: (params) => {
+                            let colorList = ['#39B3FF', '#47E0E0', '#7891D9', '#83D978', '#C7A530', '#FF8439']
+                            return colorList[params.dataIndex]
+                        }
+                    },
+                },
             }]
         }
     }
diff --git a/src/components/charts/MonCap.vue b/src/components/charts/MonCap.vue
index c6a4455..2824b65 100644
--- a/src/components/charts/MonCap.vue
+++ b/src/components/charts/MonCap.vue
@@ -90,19 +90,14 @@
 			if (res.code == 1) {
 				let optionData = {
 					circle: [{
-						name: '鍛婅鏁�',
-						value: 10,
+						name: '鍗曚綋瀹归噺楂樺憡璀�',
+						value: 0,
 						color: '#00DFFC',
 					},
 					{
-						name: '鍛婅鎬绘暟',
-						value: 10,
+						name: '鍗曚綋瀹归噺浣庡憡璀�',
+						value: 0,
 						color: '#ED4882',
-					},
-					{
-						name: '鍛婅鏈烘埧鏁�',
-						value: 10,
-						color: '#2EEA9D',
 					},
 					]
 				}
diff --git a/src/components/charts/RoseChart.vue b/src/components/charts/RoseChart.vue
index 11eb63b..70f0af8 100644
--- a/src/components/charts/RoseChart.vue
+++ b/src/components/charts/RoseChart.vue
@@ -58,7 +58,7 @@
 					left: "40%",
 					bottom: '1%',
 					align: 'left',
-					data: ['鍦ㄧ嚎娴厖', '鏁呴殰鏁伴噺'],
+					data: ['鍦ㄧ嚎娴厖', '閫氳鏁呴殰鏁伴噺'],
 					textStyle: {
 						color: '#fff'
 					}
@@ -152,7 +152,7 @@
 				},
 				{
 					value: 0,
-					name: '鏁呴殰鏁伴噺',
+					name: '閫氳鏁呴殰鏁伴噺',
 					color: '#8278E9'
 				},
 				{
diff --git a/src/components/charts/dischargeCircuit.vue b/src/components/charts/dischargeCircuit.vue
index d526df6..4989352 100644
--- a/src/components/charts/dischargeCircuit.vue
+++ b/src/components/charts/dischargeCircuit.vue
@@ -86,7 +86,6 @@
 					maxYAxis.push(maxInt);
 				});
 				self.optionSet(xAxisData, maxYAxis, xData, data);
-				console.log(xAxisData, data)
 			}
 		},
 		outClear() {
diff --git a/src/components/charts/monomerVoltage.vue b/src/components/charts/monomerVoltage.vue
index ec8daf3..4065b6c 100644
--- a/src/components/charts/monomerVoltage.vue
+++ b/src/components/charts/monomerVoltage.vue
@@ -66,29 +66,29 @@
 		},
 		wsMessage(res) {
 			let self = this;
-			let legendData = [];
 			let yAxisData = [];
-			let data = [];
+			let Data = [{
+				name: '鍛婅鏁�',
+				type: 'bar',
+				data: [],
+				itemStyle: {
+					normal: {
+						color: (params) => {
+							let colorList = ['#37a9b3', '#f3535f', '#ff8b00', '#757ffb', '#4ba0d9', '#7fc57c']
+							return colorList[params.dataIndex]
+						}
+					},
+				},
+			}];
 			if (res.code == 1) {
 				let result = res.data;
-				let index = 0;
 				for (const key in result) {
-					let obj = {
-						name: key,
-						type: 'bar',
-						data: []
-					}
-					legendData.push(key);
 					for (const item in result[key]) {
-						if (index === 0) {
-							yAxisData.push(item);
-						}
-						obj.data.push(result[key][item])
+						yAxisData.push(item);
+						Data[0].data.push(result[key][item])
 					}
-					data.push(obj);
-					index++;
 				}
-				self.optionSet(legendData, yAxisData, data);
+				self.optionSet(yAxisData, Data);
 			}
 		},
 		outClear() {
@@ -103,35 +103,22 @@
 			if (!dataList) {
 				self.postData()
 			} else {
-				self.optionSet(dataList.legendData, dataList.yAxisData, dataList.data);
+				self.optionSet(dataList.yAxisData, dataList.data);
 			}
 		},
-		optionSet(legendData, yAxisData, data) {
+		optionSet(yAxisData, data) {
 			let option = {
-				// title: {
-				//     text: '涓栫晫浜哄彛鎬婚噺',
-				//     subtext: '鏁版嵁鏉ヨ嚜缃戠粶'
-				// },
 				tooltip: {
 					trigger: 'axis',
 					axisPointer: {
 						type: 'shadow'
 					}
 				},
-				legend: {
-					right: "4%",
-					data: legendData,//['鍗曚綋鐢靛帇', '鍗曚綋鍐呴樆','鍗曚綋娓╁害'],
-					itemStyle: {
-						right: "0",
-					},
-					textStyle: {
-						color: "#fff"
-					}
-				},
 				grid: {
+					top: 20,
+					right: 40,
+					bottom: 20,
 					left: '3%',
-					right: '4%',
-					bottom: '3%',
 					containLabel: true
 				},
 				xAxis: {

--
Gitblit v1.9.1