diff --git a/src/views/AiEmotion.vue b/src/views/AiEmotion.vue index 57c85c4..9b5497f 100644 --- a/src/views/AiEmotion.vue +++ b/src/views/AiEmotion.vue @@ -1439,7 +1439,8 @@ defineExpose({ display: block; color: #FFD700; font-weight: bold; - margin-bottom: 10px; + margin-top: 0px; + margin-bottom: 20px; font-size: 22px; } @@ -1447,6 +1448,7 @@ defineExpose({ display: block; color: white; font-size: 20px; + text-align: center; } @@ -1604,7 +1606,7 @@ defineExpose({ background-repeat: no-repeat; width: 70%; height: 400px; - min-height: 400px; + min-height: 35rem; text-align: center; margin: 0 auto; margin-top: 3%; @@ -1621,7 +1623,7 @@ defineExpose({ background-repeat: no-repeat; width: 95%; height: auto; - min-height: 40rem; + min-height: 50rem; margin: 0 auto; } diff --git a/src/views/components/emotionalBottomRadar.vue b/src/views/components/emotionalBottomRadar.vue index 14b400b..51f2d73 100644 --- a/src/views/components/emotionalBottomRadar.vue +++ b/src/views/components/emotionalBottomRadar.vue @@ -38,9 +38,14 @@ function initEmotionalBottomRadar(KlineData, barAndLineData) { } }) - // 找到最小值并向下取整到10的整数倍 - let minValue = Math.min(...allKlineValues.filter(val => typeof val === 'number' && !isNaN(val))) - let yAxisMin = Math.floor(minValue / 10) * 10 + // 找到最小值和最大值 + let validValues = allKlineValues.filter(val => typeof val === 'number' && !isNaN(val)) + let minValue = Math.min(...validValues) + let maxValue = Math.max(...validValues) + + // 最小值向下取整,最大值向上取整 + let yAxisMin = Math.floor(minValue) + let yAxisMax = Math.ceil(maxValue) // 红线,取第二个值 let redLineDataArray = barAndLineData.map(subArray => subArray[1]) // 色块数据格式化 @@ -348,7 +353,8 @@ function initEmotionalBottomRadar(KlineData, barAndLineData) { type: 'value', gridIndex: 0, splitNumber: 4, - min: yAxisMin, // 设置y轴最小值为数据中最小值的10的整数倍 + min: yAxisMin, // 设置y轴最小值为数据最小值向下取整 + max: yAxisMax, // 设置y轴最大值为数据最大值向上取整 axisLine: { lineStyle: { color: 'white' // y轴坐标轴颜色