bihuisong 1 ano atrás
pai
commit
777bed3589

+ 18 - 21
ruoyi-admin/src/main/resources/templates/websiteAccess.html

@@ -359,6 +359,7 @@
       // 基于准备好的dom,初始化echarts实例
       var myChart = echarts.init(document.getElementById("chart-panel3"));
       let dataSourceThree = [[${dataSourceThree}]];
+      console.log("dataSourceThree",dataSourceThree)
       function getPageList(arrays, pageNum, pageSize) {
         //计算分页页数
         pageNum = pageNum - 1;
@@ -368,9 +369,9 @@
         //循环判断值
         let startIndex = pageNum <= 0 ? 0 : pageNum * pageSize;
         let endIndex =
-          (pageNum + 1) * pageSize > pageRows
-            ? pageRows
-            : (pageNum + 1) * pageSize;
+                (pageNum + 1) * pageSize > pageRows
+                        ? pageRows
+                        : (pageNum + 1) * pageSize;
         if (startIndex > pageRows) return dataList;
         for (startIndex; startIndex < endIndex; startIndex++) {
           dataList.push(arrays[startIndex]);
@@ -380,19 +381,17 @@
 
       let yLabel = dataSourceThree.columnRankingList;
       var pageNum = 1,
-        pageSize = 10;
+              pageSize = 10;
       var baseRows = getPageList(yLabel, pageNum, pageSize);
+      console.log("baseRows",baseRows)
       let yData = [];
       baseRows.forEach((item,index) => {
+        // baseRows.push(item)
         yData.push(dataSourceThree.browseList[index]);
       });
-      var browseList = dataSourceThree.browseList;
-      var max = browseList.reduce(function(a, b) {
-        return Math.max(a, b);
-      });
       let bgData = [];
       for (let i in yData) {
-        bgData.push(max);
+        bgData.push(400);
       }
 
       var option = {
@@ -410,13 +409,13 @@
           },
           formatter: function (params) {
             return (
-              params[0].name +
-              "<br/>" +
-              "<span style='display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:rgba(36,207,233,0.9)'></span>" +
-              params[0].seriesName +
-              " : " +
-              params[0].value +
-              " <br/>"
+                    params[0].name +
+                    "<br/>" +
+                    "<span style='display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:rgba(36,207,233,0.9)'></span>" +
+                    params[0].seriesName +
+                    " : " +
+                    params[0].value +
+                    " <br/>"
             );
           },
         },
@@ -519,15 +518,13 @@
         rows.forEach((item,index) => {
           baseRows.push(item)
           yData.push(dataSourceThree.browseList[index]);
+          console.log(item,dataSourceThree.browseList[index])
         });
+        console.log("dataSourceThree.browseList",yData)
         //x轴
         bgData.splice(0, 1);
-        var browseList = dataSourceThree.browseList;
-        var max = browseList.reduce(function(a, b) {
-          return Math.max(a, b);
-        });
         rows.forEach((item) => {
-          bgData.push(max);
+          bgData.push(400);
         });
 
         myChart.setOption({