feat: Strip中增加Reference线
This commit is contained in:
parent
e667205ba0
commit
f0efa99df5
|
@ -707,6 +707,7 @@ export default {
|
|||
const spectrumLineSeries = findSeriesByName(this.option.series, 'Spectrum')
|
||||
const thumbnailSpectrumLineSeries = findSeriesByName(this.thumbnailOption.series, 'Spectrum')
|
||||
const compareLineSeries = findSeriesByName(this.option.series, 'Compare')
|
||||
const stripReferenceLineSeries = findSeriesByName(this.option.series, 'StripReference')
|
||||
|
||||
switch (key) {
|
||||
// 折线y轴类型变化
|
||||
|
@ -794,6 +795,10 @@ export default {
|
|||
this.redrawLineBySeriesName('Compare', this.energyCompareLine, this.channelCompareLine)
|
||||
}
|
||||
|
||||
if (this.channelStripReferenceLine) {
|
||||
this.redrawLineBySeriesName('StripReference', this.energyStripReferenceLine, this.channelStripReferenceLine)
|
||||
}
|
||||
|
||||
break
|
||||
|
||||
// Lines 和 Scatter 的切换
|
||||
|
@ -808,11 +813,22 @@ export default {
|
|||
compareLineSeries.type = 'line'
|
||||
compareLineSeries.symbol = 'none'
|
||||
|
||||
stripReferenceLineSeries.type = 'line'
|
||||
stripReferenceLineSeries.symbol = 'none'
|
||||
|
||||
this.redrawLineBySeriesName('Spectrum', this.energyData.spectrumLine, this.channelData.spectrumLine)
|
||||
|
||||
if (this.channelCompareLine) {
|
||||
this.redrawLineBySeriesName('Compare', this.energyCompareLine, this.channelCompareLine)
|
||||
}
|
||||
|
||||
if (this.channelStripReferenceLine) {
|
||||
this.redrawLineBySeriesName(
|
||||
'StripReference',
|
||||
this.energyStripReferenceLine,
|
||||
this.channelStripReferenceLine
|
||||
)
|
||||
}
|
||||
} else {
|
||||
spectrumLineSeries.type = 'scatterGL'
|
||||
spectrumLineSeries.symbol = 'circle'
|
||||
|
@ -823,6 +839,9 @@ export default {
|
|||
compareLineSeries.type = 'scatterGL'
|
||||
compareLineSeries.symbol = 'circle'
|
||||
|
||||
stripReferenceLineSeries.type = 'scatterGL'
|
||||
stripReferenceLineSeries.symbol = 'circle'
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.rangeScatter()
|
||||
})
|
||||
|
@ -870,7 +889,7 @@ export default {
|
|||
|
||||
clearPeakLine() {
|
||||
this.opts.notMerge = true
|
||||
this.option.series.splice(6)
|
||||
this.option.series.splice(7)
|
||||
this.$nextTick(() => {
|
||||
this.resetChartOpts()
|
||||
})
|
||||
|
@ -1261,14 +1280,40 @@ export default {
|
|||
? this.pointlistLimitY(this.channelCompareLine.pointlist)
|
||||
: this.pointlistLimit(this.channelCompareLine.pointlist, x1, x2, y1, y2),
|
||||
}
|
||||
const energyCompareLine = {
|
||||
...this.energyCompareLine,
|
||||
pointlist: isReset
|
||||
? this.pointlistLimitY(this.energyCompareLine.pointlist)
|
||||
: this.pointlistLimit(this.energyCompareLine.pointlist, x1, x2, y1, y2),
|
||||
|
||||
let energyCompareLine = []
|
||||
if (this.energyCompareLine) {
|
||||
energyCompareLine = {
|
||||
...this.energyCompareLine,
|
||||
pointlist: isReset
|
||||
? this.pointlistLimitY(this.energyCompareLine.pointlist)
|
||||
: this.pointlistLimit(this.energyCompareLine.pointlist, x1, x2, y1, y2),
|
||||
}
|
||||
}
|
||||
|
||||
this.redrawLineBySeriesName('Compare', energyCompareLine, channelCompareLine)
|
||||
}
|
||||
|
||||
if (this.channelStripReferenceLine) {
|
||||
const channelStripReferenceLine = {
|
||||
...this.channelStripReferenceLine,
|
||||
pointlist: isReset
|
||||
? this.pointlistLimitY(this.channelStripReferenceLine.pointlist)
|
||||
: this.pointlistLimit(this.channelStripReferenceLine.pointlist, x1, x2, y1, y2),
|
||||
}
|
||||
|
||||
let energyStripReferenceLine = []
|
||||
if (this.energyStripReferenceLine) {
|
||||
energyStripReferenceLine = {
|
||||
...this.energyStripReferenceLine,
|
||||
pointlist: isReset
|
||||
? this.pointlistLimitY(this.energyStripReferenceLine.pointlist)
|
||||
: this.pointlistLimit(this.energyStripReferenceLine.pointlist, x1, x2, y1, y2),
|
||||
}
|
||||
}
|
||||
|
||||
this.redrawLineBySeriesName('StripReference', energyStripReferenceLine, channelStripReferenceLine)
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -1440,7 +1485,7 @@ export default {
|
|||
}
|
||||
this.handleResetChart()
|
||||
this.clearCompareLine()
|
||||
if(isOperating) {
|
||||
if (isOperating) {
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -1508,14 +1553,42 @@ export default {
|
|||
|
||||
const { success, result, message } = await getAction(url, param)
|
||||
if (success) {
|
||||
const [channelData, energyData] = result
|
||||
this.channelCompareLine = channelData
|
||||
this.energyCompareLine = energyData
|
||||
this.redrawLineBySeriesName('Compare', energyData, channelData, true, channelData.color)
|
||||
if (this.isStrip) {
|
||||
const { reference: referenceLine, result: compareLine } = result
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.thumbnailOption.yAxis.max = getAxisMax(this.getChart(), 'yAxis')
|
||||
})
|
||||
this.channelCompareLine = compareLine[0]
|
||||
this.energyCompareLine = compareLine[1]
|
||||
this.redrawLineBySeriesName(
|
||||
'Compare',
|
||||
this.energyCompareLine,
|
||||
this.channelCompareLine,
|
||||
true,
|
||||
this.channelCompareLine.color
|
||||
)
|
||||
|
||||
this.channelStripReferenceLine = referenceLine[0]
|
||||
this.energyStripReferenceLine = referenceLine[1]
|
||||
this.redrawLineBySeriesName(
|
||||
'StripReference',
|
||||
this.energyStripReferenceLine,
|
||||
this.channelStripReferenceLine,
|
||||
true,
|
||||
this.channelStripReferenceLine.color
|
||||
)
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.thumbnailOption.yAxis.max = getAxisMax(this.getChart(), 'yAxis')
|
||||
})
|
||||
} else {
|
||||
const [channelData, energyData] = result
|
||||
this.channelCompareLine = channelData
|
||||
this.energyCompareLine = energyData
|
||||
this.redrawLineBySeriesName('Compare', energyData, channelData, true, channelData.color)
|
||||
|
||||
this.$nextTick(() => {
|
||||
this.thumbnailOption.yAxis.max = getAxisMax(this.getChart(), 'yAxis')
|
||||
})
|
||||
}
|
||||
|
||||
this.$emit('compareSuccess', this.isStrip)
|
||||
} else {
|
||||
|
@ -1537,6 +1610,14 @@ export default {
|
|||
}
|
||||
this.channelCompareLine = undefined
|
||||
this.energyCompareLine = undefined
|
||||
|
||||
const stripReferenceLine = findSeriesByName(this.option.series, 'StripReference')
|
||||
if (stripReferenceLine) {
|
||||
stripReferenceLine.data = []
|
||||
this.resetThumbnailChartDataMax()
|
||||
}
|
||||
this.channelStripReferenceLine = undefined
|
||||
this.energyStripReferenceLine = undefined
|
||||
},
|
||||
|
||||
// 重新分析
|
||||
|
|
|
@ -976,7 +976,6 @@ export default {
|
|||
|
||||
// Compare 或 Strip 了
|
||||
handleCompareSuccess(isStrip) {
|
||||
console.log('%c [ isStrip ]-973', 'font-size:13px; background:pink; color:#bf2c9f;', isStrip)
|
||||
if (isStrip) {
|
||||
this.isStriping = true
|
||||
} else {
|
||||
|
|
|
@ -44,3 +44,8 @@ export const compareLineSeries = buildLineSeries('Compare', [], '#fff', {
|
|||
symbolSize: 2,
|
||||
z: 7
|
||||
})
|
||||
|
||||
export const stripReferenceLineSeries = buildLineSeries('StripReference', [], '#fff', {
|
||||
symbolSize: 2,
|
||||
z: 8
|
||||
})
|
||||
|
|
|
@ -5,7 +5,8 @@ import {
|
|||
compareLineSeries,
|
||||
lcLineSeries,
|
||||
scacLineSeries,
|
||||
spectrumSeries
|
||||
spectrumSeries,
|
||||
stripReferenceLineSeries
|
||||
} from './seriesBuilder'
|
||||
|
||||
export const GammaOptions = {
|
||||
|
@ -103,7 +104,15 @@ export const GammaOptions = {
|
|||
max: 'dataMax',
|
||||
animation: false
|
||||
},
|
||||
series: [spectrumSeries, baseLineSeries, lcLineSeries, scacLineSeries, baseLineCtrlPoint, compareLineSeries],
|
||||
series: [
|
||||
spectrumSeries,
|
||||
baseLineSeries,
|
||||
lcLineSeries,
|
||||
scacLineSeries,
|
||||
baseLineCtrlPoint,
|
||||
compareLineSeries,
|
||||
stripReferenceLineSeries
|
||||
],
|
||||
brush: {}
|
||||
},
|
||||
// 缩略图配置
|
||||
|
|
Loading…
Reference in New Issue
Block a user