seimin 3 年之前
父节点
当前提交
0c2494dcde
共有 2 个文件被更改,包括 15 次插入2 次删除
  1. 1 1
      src/components/GroupPerformance.vue
  2. 14 1
      src/components/TimeUtilization.vue

+ 1 - 1
src/components/GroupPerformance.vue

@@ -53,7 +53,7 @@ export default {
53 53
         },
54 54
         grid: {
55 55
           left: '0%',
56
-          top: '5%',
56
+          top: '0%',
57 57
           right: '5%',
58 58
           bottom: '5%',
59 59
           containLabel: true

+ 14 - 1
src/components/TimeUtilization.vue

@@ -48,6 +48,18 @@ export default {
48 48
             }
49 49
           },
50 50
           axisLabel: {
51
+            formatter: function (params) {
52
+              params = params.slice(0, 9)
53
+              const len = params.length
54
+              let str = ''
55
+              for (let i = 0; i < len; i++) {
56
+                str += params[i]
57
+                if (i % 4 === 0 && i !== 0) {
58
+                  str += '\n'
59
+                }
60
+              }
61
+              return str
62
+            },
51 63
             textStyle: {
52 64
               color: '#d4d6d7',
53 65
               fontSize: 12
@@ -147,6 +159,7 @@ export default {
147 159
         this.groupWorkRatioNum.push(item[1]) // 获取到的数据
148 160
         this.groupWorkRatioName.push(item[0]) // 获取到的名称
149 161
       })
162
+      console.log(this.groupWorkRatioName)
150 163
       this.draw()
151 164
       this.polling()
152 165
     },
@@ -168,7 +181,7 @@ export default {
168 181
 </script>
169 182
 
170 183
 <style lang="less">
171
-.time-utilization{
184
+.time-utilization {
172 185
   height: 2.1375rem;
173 186
   margin: 0 auto;
174 187
 }