Commit f82b373d authored by 陈龙's avatar 陈龙

fix: 修复历史曲线同期对比出现max/min设置错误导致无法正确显示曲线的问题

parent ed252983
......@@ -251,12 +251,23 @@ const SingleChart = memo((props) => {
}
} else {
try {
let _maxMap = {};
// 确定哪些是需要标记min/max
_option.series.forEach(item => {
if (item.data.length === 0) {
// 泳道图没有yAxisIndex
if (item.data.length === 0 && (item.yAxisIndex || item.yAxisIndex === 0)) {
if (item.yAxisIndex || item.yAxisIndex === 0) {
if (!_maxMap[item.yAxisIndex]) _maxMap[item.yAxisIndex] = 'noData'
}
} else {
_maxMap[item.yAxisIndex] = 'data';
}
});
// 标记min/max
_option.series.forEach(item => {
if (_maxMap[item.yAxisIndex] === 'noData') {
_option.yAxis[item.yAxisIndex].max = 1;
_option.yAxis[item.yAxisIndex].min = 0;
item.data = [[moment(dataSource?.[0]?.dateFrom).valueOf(), null], [moment(dataSource?.[0]?.dateTo).valueOf(), null]]
}
})
} catch (e) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment