| | |
| | | }); |
| | | return newTimes; |
| | | } |
| | | function refreshY(factorDatas) { |
| | | function refreshY(factorDatas, useRange) { |
| | | const allSeries = new Map(); |
| | | for (const key in factorDatas.factor) { |
| | | if (Object.hasOwnProperty.call(factorDatas.factor, key)) { |
| | |
| | | const newSeries = e.datas.map((v) => v.factorData); |
| | | series.data = series.data.concat(newSeries); |
| | | // 计算数据范围 |
| | | const { min, max } = dataRange(series.data); |
| | | series.min = min; |
| | | series.max = max; |
| | | if (useRange != false) { |
| | | // const { min, max } = dataRange(series.data); |
| | | // series.min = min; |
| | | // series.max = max; |
| | | } |
| | | // 记录最新数据 |
| | | series.currentData = |
| | | Math.round(series.data[series.data.length - 1] * 10) / 10; |
| | |
| | | } |
| | | |
| | | export default { |
| | | parseData(factorDatas, selectedFactors) { |
| | | parseData(factorDatas, selectedFactors, useRange) { |
| | | const xAxis = refreshX(factorDatas); |
| | | const allSeries = refreshY(factorDatas); |
| | | const allSeries = refreshY(factorDatas, useRange); |
| | | return toList(xAxis, allSeries, selectedFactors); |
| | | } |
| | | }; |