wenbobowen 4 лет назад
Родитель
Сommit
8be9c0ba24

+ 4 - 3
src/utils/options.js

@@ -1,11 +1,12 @@
-export function getOption(xAxis, data = [], type, dataZoom = {}) {
+export function getOption(xAxis, data = [], type, dataZoom = {}, series = { formatter: '' }) {
   return {
     'color': ['#3AA1FF'],
     'tooltip': {
       'trigger': 'axis',
       'axisPointer': {
         'type': 'line'
-      }
+      },
+      'formatter': `{b0}: {c}${series.formatter}`
     },
     'grid': {
       'left': '0',
@@ -60,7 +61,7 @@ export function getOption(xAxis, data = [], type, dataZoom = {}) {
         'normal': {
           'label': {
             'show': true,
-            'formatter': '{c}',
+            'formatter': `{c}${series.formatter}`,
             'position': 'top'
           }
         }

+ 1 - 1
src/views/dataBigManage/components/throughputModule/index.vue

@@ -176,7 +176,7 @@ export default {
       // 积压率
       if (requirementBacklogRateChart) {
         const { xaxis, yaxis } = requirementBacklogRateChart
-        this.requirementBacklogRateChartOption = getOption(xaxis, yaxis[0].data, 'line', { endValue: 6 })
+        this.requirementBacklogRateChartOption = getOption(xaxis, yaxis[0].data, 'line', { endValue: 6 }, { formatter: '%' })
       }
       if (versionRequirementChart) {
         this.mainData = { ...this.mainData, versionRequirementChart }