Răsfoiți Sursa

Merge remote-tracking branch 'origin/feature-monitor'

Zimo 1 săptămână în urmă
părinte
comite
145aa2d820
1 a modificat fișierele cu 7 adăugiri și 3 ștergeri
  1. 7 3
      src/views/pms/device/monitor/TdDeviceInfo.vue

+ 7 - 3
src/views/pms/device/monitor/TdDeviceInfo.vue

@@ -238,11 +238,11 @@ const render = () => {
 
   const values = Object.values(chartMap.value).flatMap((item) => item.value.map((d) => d.value))
 
-  const maxVal = Math.max(...values)
+  const maxVal = Math.max(...values, 10000)
   const minVal = Math.min(...values, -100)
 
   const maxDigits = (Math.floor(maxVal) + '').length
-  const minDigits = (Math.floor(Math.abs(minVal)) + '').length
+  const minDigits = (Math.floor(Math.abs(minVal)) + '').length - 1
   const interval = Math.max(maxDigits, minDigits)
 
   maxInterval = interval
@@ -285,7 +285,11 @@ const render = () => {
       max: maxInterval,
       interval: 1,
       axisLabel: {
-        formatter: (v) => (v === 0 ? '0' : v > 0 ? Math.pow(10, v) : -Math.pow(10, -v))
+        formatter: (v) => {
+          const num = v === 0 ? 0 : v > 0 ? Math.pow(10, v) : -Math.pow(10, -v)
+
+          return num.toLocaleString()
+        }
       }
     },
     legend: {