Przeglądaj źródła

feat: 完善数据看板 #190

CaIon 1 rok temu
rodzic
commit
c6e85d5b57
1 zmienionych plików z 3 dodań i 0 usunięć
  1. 3 0
      web/src/pages/Detail/index.js

+ 3 - 0
web/src/pages/Detail/index.js

@@ -72,6 +72,7 @@ const Detail = (props) => {
     stack: true,
     legends: {
       visible: true,
+      selectMode: 'single',
     },
     title: {
       visible: true,
@@ -216,6 +217,8 @@ const Detail = (props) => {
       } else if (dataExportDefaultTime === 'week') {
         timeGranularity = 604800;
       }
+      // sort created_at
+      data.sort((a, b) => a.created_at - b.created_at);
       data.forEach((item) => {
         item['created_at'] =
           Math.floor(item['created_at'] / timeGranularity) * timeGranularity;