浏览代码

Merge branch '王立生' of sckj/mz-cloud into master

sckj 2 年之前
父节点
当前提交
8abcd59360
共有 1 个文件被更改,包括 15 次插入2 次删除
  1. 15 2
      ruoyi-ui/src/components/xxtjEcharts/EchartsBox4/index.vue

+ 15 - 2
ruoyi-ui/src/components/xxtjEcharts/EchartsBox4/index.vue

@@ -196,7 +196,7 @@ export default {
           return { name: item.label, value: this.newTableList[0]?this.newTableList[0][item.prop]:0 }
         })
       }
-
+      let zbz=this.zbz;
       var myChart = this.$echarts.init(document.getElementById(id))
       var option = {
         // color: ['#288DEF'],
@@ -224,8 +224,21 @@ export default {
         },
         yAxis: {
           type: 'value',
-          //scale: true,
+          scale: true,
           // inverse: true,
+          min: function(value) {//取最小值向下取整为最小刻度
+            let min=Math.ceil(value.min);
+            if (zbz<min)
+              min=zbz;
+            return  min;
+          },
+          max: function(value) {//取最大值向上取整为最大刻度
+            let max=Math.ceil(value.max);
+            if (zbz>max)
+              max=zbz;
+            return  max;
+          },
+
           show: true,
           name: '单位:' + unit,
           nameTextStyle: {