From 2b05362eba2f989b7857349cc9a3a1c12f8181b6 Mon Sep 17 00:00:00 2001 From: schangxiang@126.com <schangxiang@126.com> Date: 周五, 26 9月 2025 11:35:50 +0800 Subject: [PATCH] 222 --- yiqi_screen/src/components/ProductionStatistics.vue | 86 +++++++++++++++++++++++++------------------ 1 files changed, 50 insertions(+), 36 deletions(-) diff --git a/yiqi_screen/src/components/ProductionStatistics.vue b/yiqi_screen/src/components/ProductionStatistics.vue index b8654cc..a1c07ef 100644 --- a/yiqi_screen/src/components/ProductionStatistics.vue +++ b/yiqi_screen/src/components/ProductionStatistics.vue @@ -1,5 +1,6 @@ <template> - <div class="box-container" id="echarts4"></div> + <!-- 鏈彮/鏈湀浜ч噺缁熻 --> + <div class="box-container box4" id="echarts4"></div> </template> <script> @@ -22,6 +23,10 @@ }, watch: { produceStatisData(val) { + // 娴嬭瘯鐢細 + // val.currentShiftProduceNum = 280; + // val.currentShiftPlanNum = 300; + // 褰撳墠鐝粍瀹為檯鐢熶骇鏁伴噺 currentShiftProduceNum // 褰撳墠鐝粍璁″垝鐢熶骇鏁伴噺 currentShiftPlanNum var num1 = val.currentShiftProduceNum; //瀹為檯鐢熶骇鏁伴噺 @@ -34,8 +39,12 @@ this.$set(this.option.series[0], "data", [ // { value: 1 }, //瀹為檯鐢熶骇鏁伴噺 1/ (9+1) = 10% // { value: 9 }, - { value: Math.floor(num1) }, //瀹為檯鐢熶骇鏁伴噺 - { value: Math.floor(num2) }, + { + value: num1, + }, //瀹為檯鐢熶骇鏁伴噺 + { + value: num2, + }, ]); var num3 = val.currentMonthProduceNum; var num4 = val.currentMonthPlanNum - val.currentMonthProduceNum; @@ -45,8 +54,8 @@ num4 = 10; } this.$set(this.option.series[1], "data", [ - { value: Math.floor(num3) }, - { value: Math.floor(num4) }, + { value: num3 }, + { value: num4 }, ]); this.myChart.setOption(this.option); @@ -56,29 +65,14 @@ mounted() { this.myChart = this.$echarts.init(document.getElementById("echarts4")); this.option = { - color: ["#00f6fe", "#c4c3d6"], + color: ["#00f6fe", "transparent"], // 鎻掑叆鑳屾櫙鍥� - // graphic: [ + // graphic: [ // { // type: "image", // id: "background1", - // left: "20px", // 鏍规嵁鐜舰鍥剧殑浣嶇疆璋冩暣 - // top: "60px", // 鏍规嵁鐜舰鍥剧殑浣嶇疆璋冩暣 - // z: -10, - // bounding: "raw", - // origin: [-25, -25], - // style: { - // image: require(`@/assets/images/quan.png`), // 绗竴涓幆褰㈠浘鐨勮儗鏅浘鐗囪矾寰� - // width: 100, - // height: 100, - // opacity: 1, - // }, - // }, - // { - // type: "image", - // id: "background2", - // left: "153px", // 鏍规嵁鐜舰鍥剧殑浣嶇疆璋冩暣 - // top: "60px", // 鏍规嵁鐜舰鍥剧殑浣嶇疆璋冩暣 + // left: "13px", // 鏍规嵁鐜舰鍥剧殑浣嶇疆璋冩暣 + // top: "61px", // 鏍规嵁鐜舰鍥剧殑浣嶇疆璋冩暣 // z: -10, // bounding: "raw", // origin: [0, 0], @@ -86,27 +80,42 @@ // image: require(`@/assets/images/quan.png`), // 绗竴涓幆褰㈠浘鐨勮儗鏅浘鐗囪矾寰� // width: 100, // height: 100, - // opacity: 1, + // }, + // }, + // { + // type: "image", + // id: "background2", + // left: "131px", // 鏍规嵁鐜舰鍥剧殑浣嶇疆璋冩暣 + // top: "61px", // 鏍规嵁鐜舰鍥剧殑浣嶇疆璋冩暣 + // z: -10, + // bounding: "raw", + // origin: [0, 0], + // style: { + // image: require(`@/assets/images/quan.png`), // 绗竴涓幆褰㈠浘鐨勮儗鏅浘鐗囪矾寰� + // width: 100, + // height: 100, // }, // }, // ], - series: [ { name: "Access From", type: "pie", - // radius: ["25%", "40%"], - radius: ["30%", "37%"], //鐜彉缁� - center: ["26%", "47%"], - avoidLabelOverlap: false, + // padAngle: 5, //鐜笌鐜箣闂寸殑闂撮殭 + radius: ["29%", "36%"], //鐜彉缁� + center: ["25%", "49%"], + // avoidLabelOverlap: false, label: { show: false, position: "center", - formatter: `{d}%`, + formatter: function (params) { + return params.percent < 1 + ? params.percent + "%" + : Math.floor(params.percent) + "%"; // 鍥涜垗浜斿叆鍒版暣鏁� + }, color: "#fff", fontSize: 12, }, - emphasis: { //楗煎浘涓棿鐨勫瓧浣撳ぇ灏� scale: false, @@ -130,14 +139,19 @@ { name: "Access From", type: "pie", + // padAngle: 5, //鐜笌鐜箣闂寸殑闂撮殭 // radius: ["25%", "40%"], - radius: ["30%", "37%"], //鐜彉缁� - center: ["74%", "47%"], - avoidLabelOverlap: false, + radius: ["29%", "36%"], //鐜彉缁� + center: ["74%", "49%"], + // avoidLabelOverlap: false, label: { show: false, position: "center", - formatter: `{d}%`, + formatter: function (params) { + return params.percent < 1 + ? params.percent + "%" + : Math.floor(params.percent) + "%"; // 鍥涜垗浜斿叆鍒版暣鏁� + }, color: "#fff", fontSize: 12, }, -- Gitblit v1.9.3