2 Commits 832cc318a6 ... e7338fb293

Autore SHA1 Messaggio Data
  lipenghui e7338fb293 Merge remote-tracking branch 'origin/master' 1 settimana fa
  lipenghui cb14efaf19 运行监控x维度 1 settimana fa
1 ha cambiato i file con 8 aggiunte e 1 eliminazioni
  1. 8 1
      src/views/pms/device/monitor/TdDeviceInfo.vue

+ 8 - 1
src/views/pms/device/monitor/TdDeviceInfo.vue

@@ -184,7 +184,14 @@ const renderChart = async () => {
     xAxis: {
       type: 'category',
       data: result.value.map(d => dayjs(d.timestamp).format('YYYY-MM-DD HH:mm:ss')),
-      axisLabel: { rotate: 45 },
+      axisLabel: { rotate: 45,
+        interval: function(index, value) {
+          // 将时间字符串转换为分钟数,每60分钟显示一个刻度(1小时)
+          const minutes = dayjs(value).minute();
+          // 只显示整点的刻度(分钟为0)
+          return minutes === 0;
+        }
+      },
       inverse: true,
     },
     yAxis: {