Ver Fonte

柱状图

maxiaoxiao há 5 meses atrás
pai
commit
043efaf6d5
1 ficheiros alterados com 15 adições e 3 exclusões
  1. 15 3
      src/components/echartsTemplate/bar.vue

+ 15 - 3
src/components/echartsTemplate/bar.vue

@@ -15,9 +15,9 @@ let option = {
     },
   },
   grid: {
-    left: "2%",
+    left: "5%",
     right: "4%",
-    bottom: "15%",
+    bottom: "5%",
     top: "20%",
     containLabel: true,
   },
@@ -55,6 +55,10 @@ let option = {
   yAxis: [
     {
       type: "value",
+      name: "",
+      nameTextStyle: {
+        color: "#ffffff",
+      },
       splitLine: {
         show: false,
         lineStyle: {
@@ -73,10 +77,16 @@ let option = {
       },
     },
     {
+      // name: obj.yAxis ? obj.yAxis[0].name : "项目个数/个",
+      //       nameTextStyle: {
+      //         color: "#fff",
+      //         fontSize: 12,
+      //         padding: [0, 0, 4, 0], //name文字位置 对应 上右下左
+      //       },
       type: "value",
       name: "",
       nameTextStyle: {
-        color: "#666666",
+        color: "#ffffff",
       },
       position: "right",
       axisLine: {
@@ -153,6 +163,8 @@ export default {
       }
       option.legend.data = v.legend;
       option.xAxis.data = v.xData;
+      option.yAxis[0].name = "变化面积/km²";
+      option.series = [];
       v.yData.forEach((item, k) => {
         let o = cloneDeep(seriesItem); // JSON.parse(JSON.stringify(seriesItem));
         o.name = v.xData[k];