diff --git a/src/components/Discover/Map/Filter/ActOcc.vue b/src/components/Discover/Map/Filter/ActOcc.vue index 3c42af3..a0ac56e 100644 --- a/src/components/Discover/Map/Filter/ActOcc.vue +++ b/src/components/Discover/Map/Filter/ActOcc.vue @@ -2,8 +2,6 @@

{{ tableTitle }} ({{ tableData.length }})

- -
diff --git a/src/components/Discover/Map/Filter/ActOccCase.vue b/src/components/Discover/Map/Filter/ActOccCase.vue index 06173d8..b771a47 100644 --- a/src/components/Discover/Map/Filter/ActOccCase.vue +++ b/src/components/Discover/Map/Filter/ActOccCase.vue @@ -2,8 +2,6 @@

{{ tableTitle }} ({{ data.length }})

- -
diff --git a/src/components/Discover/Map/Filter/Attributes.vue b/src/components/Discover/Map/Filter/Attributes.vue index a31a98b..ab94fe4 100644 --- a/src/components/Discover/Map/Filter/Attributes.vue +++ b/src/components/Discover/Map/Filter/Attributes.vue @@ -185,9 +185,12 @@ export default { attRangeTotal: function() { const type = this.selectedAttName.type; - return !this.classTypes.includes(type) ? null - : this.attRangeData ? `(${this.attRangeData.length})` - : null; + let result = null; // Initialize the result variable with null + + if (this.classTypes.includes(type) && this.attRangeData) { + result = `(${this.attRangeData.length})`; // Assign the length of attRangeData if it exists + } + return result; }, attRangeData: function() { let data = []; @@ -206,7 +209,12 @@ export default { occ_ratio: this.getPercentLabel(ratio), freq: item.freq }; - result.label = type !== 'boolean' ? null : item.value ? 'Yes' : 'No'; + result.label = null; + if (type === 'boolean') { + result.label = item.value ? 'Yes' : 'No'; + } else { + result.label = null; + } return result; }) return data.sort((x, y) => y.freq - x.freq); @@ -400,7 +408,7 @@ export default { break; } // 傳給後端 - this.attValueTypeStartEnd; + // this.attValueTypeStartEnd; 是否有要呼叫函數? sonar-qube // 建立圖表 this.createChart(); } @@ -476,9 +484,15 @@ export default { break; case 'float': setLabels = data.map((item, index) => { - let x = index === 0 ? Math.floor(item.x * 100) / 100 : - index === data.length - 1 ? item.x = Math.ceil(item.x * 100) / 100 : - Math.round(item.x * 100) / 100; + let x; + if (index === 0) { + x = Math.floor(item.x * 100) / 100; + } else if (index === data.length - 1) { + item.x = Math.ceil(item.x * 100) / 100; + x = item.x; + } else { + x = Math.round(item.x * 100) / 100; + } return x }); break; @@ -640,7 +654,7 @@ export default { // 重新算圖 this.resizeMask(this.chartComplete); // 執行 timeFrameStartEnd 才會改變數據 - this.attValueTypeStartEnd; + // this.attValueTypeStartEnd; 是否有要呼叫函數? sonar-qube }, /** * 選取開始或結束時間時,要改變滑塊跟圖表 @@ -668,7 +682,13 @@ export default { this.selectArea = closestIndexes; // 重新設定 start end 日曆選取範圍 if(!isDateType) inputValue = Number(e.value.replace(/,/g, '')) ; - if(direction === 'start') isDateType ? this.endMinDate = e : this.valueEndMin = inputValue; + if(direction === 'start') { + if(isDateType){ + this.endMinDate = e; + } else { + this.valueEndMin = inputValue; + } + } else if(direction === 'end') isDateType ? this.startMaxDate = e : this.valueStartMax = inputValue; // 重新算圖 if(!isNaN(closestIndexes[0]) && !isNaN(closestIndexes[1])) this.resizeMask(this.chartComplete); diff --git a/src/views/Compare/Dashboard/Compare.vue b/src/views/Compare/Dashboard/Compare.vue index 6a9d97c..44f9ae6 100644 --- a/src/views/Compare/Dashboard/Compare.vue +++ b/src/views/Compare/Dashboard/Compare.vue @@ -441,7 +441,7 @@ console.log("TODO:", datasetsPrimary, ) let yDataPrimary; let labelPrimary = chartData.data[0].label; let datasetsSecondary = chartData.data[1].data; - let xDataSecondary; + // let xDataSecondary; let yDataSecondary; let labelSecondary = chartData.data[1].label; let primeVueSetData = {}; @@ -462,7 +462,7 @@ console.log("TODO:", datasetsPrimary, ) y: value.y === null ? null : value.y * 100 } }); - xDataSecondary = datasetsSecondary.map(i => i.x); + // xDataSecondary = datasetsSecondary.map(i => i.x); yDataSecondary = datasetsSecondary.map(i => i.y); primeVueSetData = {