From d1e7425d15ac6c6cf784ea1c84963221bd47413d Mon Sep 17 00:00:00 2001 From: ZhangXianQiang <1135831638@qq.com> Date: 星期三, 28 二月 2024 17:13:01 +0800 Subject: [PATCH] fix:完善图表 --- src/views/daoAnOffice/right/analysis/index.vue | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 52 insertions(+), 6 deletions(-) diff --git a/src/views/daoAnOffice/right/analysis/index.vue b/src/views/daoAnOffice/right/analysis/index.vue index 5b30525..1fde5a4 100644 --- a/src/views/daoAnOffice/right/analysis/index.vue +++ b/src/views/daoAnOffice/right/analysis/index.vue @@ -28,14 +28,14 @@ ]); const testData = ref([ - { name: '濂庡厜濉旇閬�', state1: 972, state2: 2124, state3: 1500 }, - { name: '钂查槼琛楅亾', state1: 972, state2: 2124, state3: 1500 }, + { name: '濂庡厜濉旇閬�', state1: 1400, state2: 3533, state3: 2316 }, + { name: '钂查槼琛楅亾', state1: 1820, state2: 4281, state3: 3064 }, { name: '鑱氭簮闀�', state1: 972, state2: 2124, state3: 1500 }, - { name: '閾舵潖琛楅亾', state1: 972, state2: 2124, state3: 1500 }, + { name: '閾舵潖琛楅亾', state1: 1109, state2: 2876, state3: 1500 }, { name: '鐭崇緤闀�', state1: 972, state2: 2124, state3: 1500 }, { name: '榫欐睜闀�', state1: 972, state2: 2124, state3: 1500 }, - { name: '澶╅┈闀�', state1: 972, state2: 2124, state3: 1500 }, - { name: '鐜夊爞琛楅亾', state1: 972, state2: 2124, state3: 1500 }, + { name: '澶╅┈闀�', state1: 972, state2: 4000, state3: 1500 }, + { name: '鐜夊爞琛楅亾', state1: 972, state2: 2878, state3: 1500 }, { name: '鐏屽彛琛楅亾', state1: 972, state2: 2124, state3: 1500 }, ]); @@ -43,9 +43,31 @@ const echartsConfig = { legend: { right: '0', + icon: 'circle', textStyle: { color: 'rgba(77, 118, 176, 1)' }, + data: [ + { + name: '閱夐┚', + itemStyle: { + color: 'rgba(0, 168, 217, 1)' + } + }, + { + name: '閰掗┚', + itemStyle: { + color: 'rgba(207, 178, 73, 1)' + } + }, + { + name: '鍏朵粬', + itemStyle: { + color: 'rgba(43, 176, 109, 1)' + } + }, + ] + }, tooltip: {}, grid: { @@ -59,7 +81,7 @@ dimensions: ['name', 'state1', 'state2', 'state3'], source: testData.value }, - xAxis: { type: 'category' }, + xAxis: { type: 'category', axisTick: false }, yAxis: {}, // Declare several bar series, each will be mapped // to a column of dataset.source by default. @@ -67,6 +89,14 @@ { type: 'bar', name: '閱夐┚', + barWidth: 13, + barGap: '50%', + label: { + show: true, // 鏄剧ず鏍囩 + position: 'top', // 鏍囩浣嶇疆 + color: 'rgba(0, 168, 217, 1)', // 鏍囩棰滆壊 + fontSize: 10, + }, itemStyle: { // 璁剧疆娓愬彉鑹� color: new echarts.graphic.LinearGradient( @@ -81,6 +111,14 @@ { type: 'bar', name: '閰掗┚', + barWidth: 13, + barGap: '50%', + label: { + show: true, // 鏄剧ず鏍囩 + position: 'top', // 鏍囩浣嶇疆 + color: 'rgba(207, 178, 73, 1)', // 鏍囩棰滆壊 + fontSize: 10, + }, itemStyle: { // 璁剧疆娓愬彉鑹� color: new echarts.graphic.LinearGradient( @@ -95,6 +133,14 @@ { type: 'bar', name: '鍏朵粬', + barWidth: 13, + barGap: '50%', + label: { + show: true, // 鏄剧ず鏍囩 + position: 'top', // 鏍囩浣嶇疆 + color: 'rgba(43, 176, 109, 1)', // 鏍囩棰滆壊 + fontSize: 10, + }, itemStyle: { // 璁剧疆娓愬彉鑹� color: new echarts.graphic.LinearGradient( -- Gitblit v1.8.0