NEZ-1262 fix: 切换 legend时 未切换Y轴刻度

This commit is contained in:
zhangyu
2021-11-18 10:37:26 +08:00
parent 170b6a4749
commit 87b49de83f

View File

@@ -428,6 +428,20 @@ export default {
}) })
this.$set(this.isGrey, index, !this.isGrey[index]) this.$set(this.isGrey, index, !this.isGrey[index])
} }
const chartInfo = this.data
const dataArg = this.seriesItem.filter((seriesItem, seriesIndex) => !this.isGrey[seriesIndex])
const maxValueCopies = this.getMaxValue(dataArg, chartInfo)
const maxValue = maxValueCopies.maxValue
// const minValue = maxValueCopies.minValue
// const dot = maxValueCopies.dot
const copies = maxValueCopies.copies
const unit = maxValueCopies.unit
getChart(this.chartIndex).setOption({
yAxis: {
minInterval: chartDataFormat.Interval(maxValue, copies, unit.type, 'min'),
maxInterval: chartDataFormat.Interval(maxValue, copies, unit.type, 'max') * Math.ceil(dataArg.length / 5)
}
})
} }
}, },
clickLegend2 (legendName, index) { clickLegend2 (legendName, index) {
@@ -516,6 +530,20 @@ export default {
}) })
this.$set(this.isGreyScreen, index, !this.isGreyScreen[index]) this.$set(this.isGreyScreen, index, !this.isGreyScreen[index])
} }
const chartInfo = this.data
const dataArg = this.seriesItemScreen.filter((seriesItem, seriesIndex) => !this.isGreyScreen[seriesIndex])
const maxValueCopies = this.getMaxValue(dataArg, chartInfo)
const maxValue = maxValueCopies.maxValue
// const minValue = maxValueCopies.minValue
// const dot = maxValueCopies.dot
const copies = maxValueCopies.copies
const unit = maxValueCopies.unit
echart.setOption({
yAxis: {
minInterval: chartDataFormat.Interval(maxValue, copies, unit.type, 'min'),
maxInterval: chartDataFormat.Interval(maxValue, copies, unit.type, 'max') * Math.ceil(dataArg.length / 5)
}
})
} }
}, },
clickScreenLegend2 (legendName, index) { clickScreenLegend2 (legendName, index) {