瀏覽代碼

bugfix--柱状图竖展示异常

qianming 1 年之前
父節點
當前提交
b8e12d38b0
共有 1 個文件被更改,包括 37 次插入26 次删除
  1. 37 26
      report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetBarchart.vue

+ 37 - 26
report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetBarchart.vue

@@ -151,6 +151,17 @@ export default {
         },
         // 轴反转
         inverse: optionsSetup.reversalX,
+        axisLabel : {
+          show: true,
+          interval: optionsSetup.textInterval,
+          // 文字角度
+          rotate: optionsSetup.textAngleX,
+          textStyle: {
+            // 坐标文字颜色
+            color: optionsSetup.colorX,
+            fontSize: optionsSetup.fontSizeX,
+          },
+        },
         axisLine: {
           show: true,
           lineStyle: {
@@ -335,18 +346,6 @@ export default {
       }
       const legendName = [];
       legendName.push("bar");
-      // x轴
-      if (optionsSetup.verticalShow) {
-        this.options.xAxis.data = [];
-        this.options.yAxis.data = axis;
-        this.options.xAxis.type = "value";
-        this.options.yAxis.type = "category";
-      } else {
-        this.options.xAxis.data = axis;
-        this.options.yAxis.data = [];
-        this.options.xAxis.type = "category";
-        this.options.yAxis.type = "value";
-      }
       for (const i in series) {
         if (series[i].type == "bar") {
           series[i].type = "bar";
@@ -416,8 +415,20 @@ export default {
           }
           return str
         }
+      };
+      // x轴
+      if (optionsSetup.verticalShow) {
+        this.options.xAxis.data = [];
+        this.options.yAxis.data = axis;
+        this.options.xAxis.type = "value";
+        this.options.yAxis.type = "category";
+      } else {
+        this.options.xAxis.data = axis;
+        this.options.yAxis.data = [];
+        this.options.xAxis.type = "category";
+        this.options.yAxis.type = "value";
+        this.options.xAxis.axisLabel = axisLabel;
       }
-      this.options.xAxis.axisLabel = axisLabel;
       this.options.legend["data"] = legendName;
       this.setOptionsLegendName(legendName);
     },
@@ -451,18 +462,6 @@ export default {
       }
       const series = [];
       const legendName = [];
-      // x轴
-      if (optionsSetup.verticalShow) {
-        this.options.xAxis.data = [];
-        this.options.yAxis.data = val.xAxis;
-        this.options.xAxis.type = "value";
-        this.options.yAxis.type = "category";
-      } else {
-        this.options.xAxis.data = val.xAxis;
-        this.options.yAxis.data = [];
-        this.options.xAxis.type = "category";
-        this.options.yAxis.type = "value";
-      }
       for (const i in val.series) {
         legendName.push(val.series[i].name);
         const obj = {};
@@ -537,8 +536,20 @@ export default {
           }
           return str
         }
+      };
+      // x轴
+      if (optionsSetup.verticalShow) {
+        this.options.xAxis.data = [];
+        this.options.yAxis.data = val.xAxis;
+        this.options.xAxis.type = "value";
+        this.options.yAxis.type = "category";
+      } else {
+        this.options.xAxis.data = val.xAxis;
+        this.options.yAxis.data = [];
+        this.options.xAxis.type = "category";
+        this.options.yAxis.type = "value";
+        this.options.xAxis.axisLabel = axisLabel;
       }
-      this.options.xAxis.axisLabel = axisLabel;
       this.options.series = series;
       this.options.legend["data"] = legendName;
       this.setOptionsLegendName(legendName);