修改事件展示查询问题
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { install$2 } from 'echarts/types/dist/shared'
|
||||
|
||||
export const yMethod = (arr: any) => {
|
||||
console.log('🚀 ~ yMethod ~ arr:', arr)
|
||||
let interval = 0
|
||||
let maxValue = 0
|
||||
let minValue = 0
|
||||
@@ -10,33 +9,6 @@ export const yMethod = (arr: any) => {
|
||||
maxValue = Math.max(...arr)
|
||||
minValue = Math.min(...arr)
|
||||
|
||||
console.log('🚀 ~ yMethod ~ minValue:', minValue,maxValue)
|
||||
|
||||
// interval = (maxValue - minValue) / 4
|
||||
// if (maxValue > 1000) {
|
||||
// interval = (Math.ceil(maxValue / 100) * 100 - Math.ceil(minValue / 100) * 100) / 4
|
||||
// min = Math.floor((minValue - interval / 2) / 100) * 100
|
||||
// max = Math.ceil((maxValue + interval / 2) / 100) * 100
|
||||
// min >= 0 ? 0 : ''
|
||||
// } else {
|
||||
// min = Math.floor(minValue - interval / 2)
|
||||
// max = Math.ceil(maxValue + interval / 2)
|
||||
// console.log('🚀 ~ yMethod ~ minValue:', minValue)
|
||||
|
||||
// if (minValue >= 0 && minValue < 10) {
|
||||
// min = 0
|
||||
// }
|
||||
// if (maxValue < 1 && maxValue >= 0) {
|
||||
// max = 1
|
||||
// }
|
||||
// interval = (max - min) / 4
|
||||
// }
|
||||
|
||||
// if (interval < 1 && interval > -1) {
|
||||
// interval = 1
|
||||
// }
|
||||
// console.log("🚀 ~ yMethod ~ minValue:", minValue)
|
||||
|
||||
if (maxValue > 1000) {
|
||||
max = Math.ceil(maxValue / 100) * 100
|
||||
min = (Math.floor(minValue / 100) - 1) * 100
|
||||
@@ -44,12 +16,12 @@ export const yMethod = (arr: any) => {
|
||||
max = Math.ceil(maxValue / 10) * 10
|
||||
min = Math.floor(minValue / 10) * 10
|
||||
}
|
||||
if (max > 0 && max < 1) {
|
||||
|
||||
if (maxValue > 0 && maxValue < 1) {
|
||||
max = 1
|
||||
}
|
||||
// if (min < 0 && min < -1) {
|
||||
// min = -1
|
||||
// }
|
||||
} else if (max == 0 && minValue > -1 && minValue < 0) {
|
||||
min = -1
|
||||
}
|
||||
|
||||
return [min, max, interval]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user