Parcourir la source

chart图表显示异常

anxiaoxia il y a 2 ans
Parent
commit
913cabbde7

+ 3 - 3
src/pages/Environment/components/chartModal/TdbRHchart.jsx

@@ -37,7 +37,7 @@ export default ({ data }) => {
     data: [tdbArr, rhArr],
     xField: 'Date',
     yField: ['Tdb', 'RH'],
-    padding: [16],
+    padding: [18],
     xAxis: {
       range: [0, 1],
     },
@@ -56,8 +56,8 @@ export default ({ data }) => {
     tooltip: {
       formatter: (item) => {
         return {
-          name: item.RH ? '湿度' : '温度',
-          value: item.RH ? `${item.RH}%` : `${item.Tdb}°C`,
+          name: 'RH' in item ? '湿度' : '温度',
+          value: 'RH' in item ? `${item.RH ? item.RH : '--'}%` : `${item.Tdb ? item.Tdb : '--'}°C`,
         };
       },
     },

+ 2 - 2
src/pages/Environment/components/chartModal/lineChart.jsx

@@ -69,10 +69,10 @@ export default ({ paramObj, spaceId }) => {
           key = objId;
         }
         arr.forEach((itemArr) => {
-          let scales = '--';
+          let scales = null;
           if (itemArr[1] == '-9999') {
             scalesCheckArr.push(itemArr[1]);
-            scales = '--';
+            scales = null;
           } else {
             scales = Number(itemArr[1].toFixed(paramObj.pointNum));
           }