Procházet zdrojové kódy

feat--柱状堆叠图优化-增加Y轴最大值和阴影

qianming před 1 rokem
rodič
revize
5ec8feaa54

+ 16 - 0
report-ui/src/views/bigscreenDesigner/designer/tools/configure/barCharts/widget-bar-stack.js

@@ -411,6 +411,22 @@ export const widgetBarStack = {
               placeholder: '',
               value: true,
             },
+            {
+              type: 'el-input-text',
+              label: '最大值',
+              name: 'maxY',
+              required: false,
+              placeholder: '',
+              value: '100',
+            },
+            {
+              type: 'el-switch',
+              label: '阴影显示',
+              name: 'isShowBackground',
+              require: false,
+              placeholder: '',
+              value: true,
+            },
             {
               type: 'el-input-text',
               label: '坐标名',

+ 12 - 1
report-ui/src/views/bigscreenDesigner/designer/widget/bar/widgetBarStackChart.vue

@@ -1,6 +1,6 @@
 <template>
   <div :style="styleObj">
-    <v-chart ref="myVChart" :options="options" autoresize />
+    <v-chart ref="myVChart" :options="options" autoresize/>
   </div>
 </template>
 
@@ -173,10 +173,20 @@ export default {
       };
       this.options.xAxis = xAxis;
     },
+    //判断有无yAxis max,无返回null
+    getOptionsYMax() {
+      const optionsSetup = this.optionsSetup;
+      let max = null;
+      if (optionsSetup.maxY !== "") {
+        max = optionsSetup.maxY
+      }
+      return max
+    },
     // Y轴设置
     setOptionsY() {
       const optionsSetup = this.optionsSetup;
       const yAxis = {
+        max: this.getOptionsYMax(),
         type: "value",
         scale: optionsSetup.scale,
         // 均分
@@ -357,6 +367,7 @@ export default {
         }
         series.push({
           name: yAxisList[i],
+          showBackground: optionsSetup.isShowBackground,
           type: "bar",
           data: data,
           barGap: "0%",