From 826570f76831a500bb06faa5c22d118776f073c4 Mon Sep 17 00:00:00 2001 From: WXL <1785969728@qq.com> Date: 星期三, 24 七月 2024 17:20:55 +0800 Subject: [PATCH] 11 --- src/views/project/indexstatistics/components/organnumchart/index.vue | 78 ++++++++++++++++++++++++-------------- 1 files changed, 49 insertions(+), 29 deletions(-) diff --git a/src/views/project/indexstatistics/components/organnumchart/index.vue b/src/views/project/indexstatistics/components/organnumchart/index.vue index 20762fa..627840e 100644 --- a/src/views/project/indexstatistics/components/organnumchart/index.vue +++ b/src/views/project/indexstatistics/components/organnumchart/index.vue @@ -16,29 +16,29 @@ export default { name: "organnumchart", components: { - Echart, + Echart }, props: { id: { type: String, - default: "organnumcgart", + default: "organnumcgart" }, width: { type: String, - default: "100%", + default: "100%" }, height: { type: String, - default: "600px", + default: "600px" }, cdata: { type: Array, - default: () => [], - }, + default: () => [] + } }, data() { return { - options: {}, + options: {} }; }, created() {}, @@ -47,49 +47,51 @@ resetOption(newData) { let organNameArr = []; let organeNumArr = []; + let organeNumArrabandonCount = []; for (let i = 0; i < newData.length; i++) { organNameArr.push(newData[i].name); organeNumArr.push(newData[i].value); + organeNumArrabandonCount.push(newData[i].value1); } this.options = { title: { - text: "鑾峰彇鍣ㄥ畼鍜岀粍缁囩殑鏁伴噺", + text: "鑾峰彇鍣ㄥ畼鍜岀粍缁囩殑鏁伴噺" }, tooltip: { trigger: "axis", axisPointer: { - type: "shadow", - }, + type: "shadow" + } }, grid: { top: "12%", left: "0", right: "0", bottom: "5%", - containLabel: true, + containLabel: true }, xAxis: { type: "category", data: organNameArr, axisLine: { - show: false, + show: false }, axisLabel: { textStyle: { color: "#566f94", //鏇存敼鍧愭爣杞存枃瀛楅鑹� - fontSize: 12, //鏇存敼鍧愭爣杞存枃瀛楀ぇ灏� + fontSize: 12 //鏇存敼鍧愭爣杞存枃瀛楀ぇ灏� }, - interval: 0, - }, + interval: 0 + } }, yAxis: { type: "value", // boundaryGap: [0, 0.01], - show: false, + show: false }, series: [ { - name: "鍣ㄥ畼鏁伴噺", + name: "鑾峰彇鏁伴噺", type: "bar", //barWidth: 20, //鏌卞浘瀹藉害 itemStyle: { @@ -100,16 +102,35 @@ textStyle: { //鏁板�兼牱寮� color: "#566f94", - fontSize: 14, - }, - }, - }, + fontSize: 14 + } + } + } }, - data: organeNumArr, + data: organeNumArr }, - ], + { + name: "寮冪敤鏁伴噺", + type: "bar", + //barWidth: 20, //鏌卞浘瀹藉害 + itemStyle: { + normal: { + label: { + show: true, //寮�鍚樉绀� + position: "top", //鍦ㄤ笂鏂规樉绀� + textStyle: { + //鏁板�兼牱寮� + color: "#566f94", + fontSize: 14 + } + } + } + }, + data: organeNumArrabandonCount + } + ] }; - }, + } }, computed: {}, watch: { @@ -118,11 +139,10 @@ this.resetOption(newData); }, immediate: true, - deep: true, - }, - }, + deep: true + } + } }; </script> -<style lang="scss" scoped> -</style> +<style lang="scss" scoped></style> -- Gitblit v1.9.3