From 7f3f3b95d1bf30a628dd8385d302343b17b5a456 Mon Sep 17 00:00:00 2001 From: Xu Zhimeng Date: Fri, 26 Jul 2024 14:27:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9VisualMap?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/BetaGammaSpectrum.vue | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/views/spectrumAnalysis/components/BetaGammaSpectrum.vue b/src/views/spectrumAnalysis/components/BetaGammaSpectrum.vue index f8635d9..5415d1a 100644 --- a/src/views/spectrumAnalysis/components/BetaGammaSpectrum.vue +++ b/src/views/spectrumAnalysis/components/BetaGammaSpectrum.vue @@ -15,7 +15,6 @@ @mouseleave="handleBorderMouseLeave" @mouseup="handleBorderMouseLeave" > -
c && b >= minX && b <= maxX && g >= minY && g <= maxY) - .map(({ b, g }) => this.buildScatterItem(b, g)) + .map(({ b, g, c }) => this.buildScatterItem(b, g, c)) }, // 构造一个scatter 的点 - buildScatterItem(xAxis, yAxis) { + buildScatterItem(xAxis, yAxis, count) { return { - value: [xAxis, yAxis], + value: [xAxis, yAxis, count], } }, + + setVisialMapParams() { + const counts = this.histogramDataList.map(({ c }) => c) + if (counts.length) { + this.twoDOption.visualMap.max = Math.max(...counts) + } else { + this.twoDOption.visualMap.max = 0 + } + }, + // 重绘矩形框区域 reDrawRect() { const chart = this.$refs.chartTwoDRef.getChartInstance()