|
|
@ -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轴坐标轴颜色 |
|
|
|