浏览代码

商品价格曲线优化v1.9.5

jwyu 11 月之前
父节点
当前提交
2eb6e2c66b
共有 1 个文件被更改,包括 14 次插入7 次删除
  1. 14 7
      src/hooks/chart/render.js

+ 14 - 7
src/hooks/chart/render.js

@@ -1561,7 +1561,7 @@ const setCommodityChart = (leftMin,leftMax) => {
     //x轴
     let xAxis = {
         ...scatterXAxis,
-        categories: commodityXData.value.map(_ => _.Name),
+        categories: commodityXData.value.filter(_=>_.IsHide===0).map(_ => _.Name),
         tickWidth: 1,
         labels: {
             style: {
@@ -1709,14 +1709,21 @@ function filterInvalidData(item){
     // console.log('last_index',last_index)
 
     let arr = item.Value.map((item,index) => {
-    if(index < first_index || index > last_index) {
-        return null
-    }else {
-        return item
-    }
+        if(index < first_index || index > last_index) {
+            return null
+        }else {
+            return item
+        }
+    })
+    // 根据设置的x轴显示隐藏去除值
+    let temArr=[]
+    commodityXData.value.forEach((i,index)=>{
+      if(i.IsHide!==1){
+        temArr.push(arr[index]||null)
+      }
     })
 
-    return arr;
+    return temArr;
 }
 function initCommodityData(data){
     const { XDataList,YDataList,EdbInfoList,ChartInfo,DataResp } = data;