소스 검색

no message

PC-20230501XVZZ\Administrator 2 년 전
부모
커밋
1303cc272d
1개의 변경된 파일177개의 추가작업 그리고 55개의 파일을 삭제
  1. 177 55
      src/views/test/components/cqzrqs.vue

+ 177 - 55
src/views/test/components/cqzrqs.vue

@@ -1,8 +1,5 @@
 <template>
-	<div>
-		<jt-echarts style="width: 380rem;height: 260rem;margin:10rem 10rem 10rem 20rem;"
-			:chartData="option"></jt-echarts>
-	</div>
+	<div id="main2"></div>
 </template>
 
 <script>
@@ -14,73 +11,198 @@
 				// category: "", //横坐标
 				// yData: [1000, 1500, 1300, 1700, 1600, 1200],
 				// y2Data: [1200, 1800, 1400, 1350, 1100, 1500],
-				option: {}
+				// option: {}
 			}
 		},
 		created() {},
 		mounted() {
-			this.typeCharts0()
+			// this.typeCharts0()
 			// let _this = this
 			// var t1=setTimeout(function() {
 			// 	_this.option.series = [{
-			// 			data: _this.category
+   //                      data: [23, 84, 101, 74, 87]
 			// 		},
 			// 		{
-			// 			data: _this.dottedBase
+			// 			data: [13, 54, 71, 24, 57]
 			// 		}
 			// 	]
 
 			// }, 1000);
-		},
-		methods: {
-			typeCharts0() {
-				this.option = {
-				  dataset: {
-				    source: [
-				      ['score', 'amount', 'product'],
-				      [89.3, 56, '天牛'],
-				      [57.1, 72, '布甲'],
-				      [74.4, 100, '黑翅蛾'],
-				      [50.1, 69, '美国白蛾'],
-				      [89.7, 20, '美国小蛾'],
-				      [68.1, 35, '黄群页蛾'],
-				      [19.6, 60, '隐翅虫']
-				    ]
-				  },
-				  grid: { containLabel: true },
-				  xAxis: { name: 'amount' },
-				  yAxis: { type: 'category' },
-				  visualMap: {
-				    show:false,
-				    orient: 'horizontal',
-				    left: 'center',
-				    min: 10,
-				    max: 100,
-				    text: ['High Score', 'Low Score'],
-				    // Map the score column to color
-				    dimension: 0,
-				    inRange: {
-				      color: ['#65B581', '#FFCE34', '#FD665F','#F300FF','#0153E5']
-				    }
-				  },
-				  series: [
-				    {
-				      type: 'bar',
-				      encode: {
-				        // Map the "amount" column to X axis.
-				        x: 'amount',
-				        // Map the "product" column to Y axis
-				        y: 'product'
-				      }
-				    }
-				  ]
+			var chartDom = document.getElementById('main2');
+			var myChart = this.$echarts.init(chartDom);
+		
+		
+			
+				let option = {
+					// backgroundColor: '#031d33',
+					legend: {
+						top: "5",
+						x: "center",
+						textStyle: {
+							fontSize: 16,
+							color: "rgba(101, 213, 255, 1)"
+						},
+						icon: "path://M512 881.777778 512 881.777778C716.222629 881.777778 881.777778 716.222629 881.777778 512 881.777778 307.777371 716.222629 142.222222 512 142.222222 307.777373 142.222222 142.222222 307.777371 142.222222 512 142.222222 716.222629 307.777373 881.777778 512 881.777778L512 881.777778ZM512 1024 512 1024C229.230208 1024 0 794.769789 0 512 0 229.230211 229.230208 0 512 0 794.769789 0 1024 229.230211 1024 512 1024 794.769789 794.769789 1024 512 1024L512 1024Z",
+						itemWidth: 8, // 设置宽度
+						itemHeight: 8, // 设置高度、
+						itemGap: 12 // 设置间距
+					},
+					tooltip: {
+						show: true,
+						trigger: "axis", //axis , item
+						backgroundColor: "RGBA(0, 49, 85, 1)",
+						borderColor: "rgba(0, 151, 251, 1)",
+						borderWidth: 1,
+						borderRadius: 0,
+						textStyle: {
+							color: "#BCE9FC",
+							fontSize: 16,
+							align: "left"
+						}
+					},
+					grid: {
+						right: "5%",
+						top: "20%",
+						left: "5%",
+						bottom: "5%",
+						containLabel: true
+					},
+					xAxis: {
+						type: "category",
+						boundaryGap: true,
+						data: ["天牛", "布甲", '黑翅蛾', '美国白蛾', '隐翅虫'],
+						axisLabel: {
+							//坐标轴刻度标签的相关设置。
+							interval: 0, //设置为 1,表示『隔一个标签显示一个标签』
+							//	margin:15,
+							textStyle: {
+								color: "#65D5FF",
+								fontStyle: "normal",
+								fontSize: 12
+							}
+						},
+						axisTick: {
+							//坐标轴刻度相关设置。
+							show: false
+						},
+						axisLine: {
+							//坐标轴轴线相关设置
+							// lineStyle: {
+							// 	color: "rgba(77, 128, 254, 0.2)"
+							// }
+						},
+						splitLine: {
+							//坐标轴在 grid 区域中的分隔线。
+							show: false,
+							lineStyle: {
+								color: "rgba(77, 128, 254, 0.2)"
+							}
+						}
+					},
+					yAxis: [{
+						type: "value",
+						splitNumber: 3,
+						axisLabel: {
+							textStyle: {
+								color: "#65D5FF",
+								fontStyle: "normal",
+								fontSize: 16
+							}
+						},
+						axisLine: {
+							show: true
+						},
+						axisTick: {
+							show: false
+						},
+						splitLine: {
+							show: false,
+							lineStyle: {
+								color: "rgba(77, 128, 254, 0.2)"
+							}
+						}
+					}],
+					series: [{
+						name: '上月',
+						type: "pictorialBar",
+						barWidth: "60%",
+						stack: "总量",
+						label: {
+							normal: {
+								show: false
+							}
+						},
+						itemStyle: {
+							normal: {
+								color: {
+									type: "linear",
+									x: 0,
+									y: 0,
+									x2: 0,
+									y2: 1,
+									colorStops: [{
+											offset: 0,
+											color: "rgba(0, 151, 251, 1)" // 0% 处的颜色
+										},
+										{
+											offset: 1,
+											color: "rgba(0, 34, 66, 0.2)" // 100% 处的颜色
+										}
+									],
+									globalCoord: false // 缺省为 false
+								} //渐变颜色
+							}
+						},
+						symbol: "path://M12.000,-0.000 C12.000,-0.000 16.074,60.121 22.731,60.121 C26.173,60.121 -3.234,60.121 0.511,60.121 C7.072,60.121 12.000,-0.000 12.000,-0.000 Z",
+
+						data: [23, 84, 101, 74, 87]
+					}, {
+						name: '本月',
+						type: "pictorialBar",
+						barWidth: "60%",
+						stack: "总量",
+						label: {
+							normal: {
+								show: false
+							}
+						},
+						itemStyle: {
+							normal: {
+								color: {
+									type: "linear",
+									x: 0,
+									y: 0,
+									x2: 0,
+									y2: 1,
+									colorStops: [{
+											offset: 0,
+											color: "rgba(48, 236, 166, 1)" // 0% 处的颜色
+										},
+										{
+											offset: 1,
+											color: "rgba(0, 34, 66, 0.2)" // 100% 处的颜色
+										}
+									],
+									globalCoord: false // 缺省为 false
+								} //渐变颜色
+							}
+						},
+						symbol: "path://M12.000,-0.000 C12.000,-0.000 16.074,60.121 22.731,60.121 C26.173,60.121 -3.234,60.121 0.511,60.121 C7.072,60.121 12.000,-0.000 12.000,-0.000 Z",
+
+						data: [13, 54, 71, 24, 57]
+					}],
 				};
-				
+				myChart.setOption(option);
 			},
+		
 		}
-
-	}
+	
 </script>
 
-<style>
+<style scoped>
+	#main2 {
+		width: 100%;
+		height: 220rem;
+		margin-top: 15rem;
+	}
 </style>