zhangzhang hace 3 meses
padre
commit
9be4bbe240
Se han modificado 1 ficheros con 11 adiciones y 6 borrados
  1. 11 6
      src/components/echarts/StackedLine.vue

+ 11 - 6
src/components/echarts/StackedLine.vue

@@ -3,6 +3,7 @@
 </template>
 <script>
 import * as echarts from "echarts";
+import { left } from "core-js/internals/array-reduce";
 export default {
   name: "StackedLine",
   props: ["indicator", "reference", "scoreList"],
@@ -67,19 +68,17 @@ export default {
               }
             }
           },
-
           {
             indicator: _this.indicator,
             center: ["50%", "55%"],
-            radius: "50%",
+            radius: "55%",
             axisName: {
               color: "#999",
               fontWeight: "bold",
               backgroundColor: "#f9f9f9",
               borderRadius: 3,
-              padding: [10, 5],
+              padding: [5, 3],
               formatter: function(value) {
-                // 将文本拆分成数组,每5个字一组
                 let words = value.split("");
                 let lines = [];
                 let currentLine = "";
@@ -93,7 +92,14 @@ export default {
                 if (currentLine.length > 0) {
                   lines.push(currentLine);
                 }
-                return lines.join("\n");
+                // 使用ECharts的富文本功能来实现左对齐
+                return `{value|${lines.join("\n")}}`;
+              },
+              rich: {
+                value: {
+                  align: "left",
+                  verticalAlign: "middle"
+                }
               }
             }
           }
@@ -108,7 +114,6 @@ export default {
                 name: "你的分数",
                 symbol: "rect",
                 symbolSize: 12,
-
                 lineStyle: {
                   type: "dashed"
                 },