|
@@ -150,7 +150,7 @@ function annotationAreas(annotations: Annotation[]): any[] {
|
|
|
function buildAnnotationOverlaySeries(annotations: Annotation[]): echarts.SeriesOption[] {
|
|
function buildAnnotationOverlaySeries(annotations: Annotation[]): echarts.SeriesOption[] {
|
|
|
const data = props.data
|
|
const data = props.data
|
|
|
if (!data) return []
|
|
if (!data) return []
|
|
|
- const gridCount = props.mode === 'merge' ? 1 : data.measurementTypes.length + 3
|
|
|
|
|
|
|
+ const gridCount = props.mode === 'merge' ? 1 : data.measurementTypes.length + 2
|
|
|
const areas = annotationAreas(annotations)
|
|
const areas = annotationAreas(annotations)
|
|
|
return Array.from({ length: gridCount }, (_, index) => ({
|
|
return Array.from({ length: gridCount }, (_, index) => ({
|
|
|
id: `annotation-overlay-${index}`,
|
|
id: `annotation-overlay-${index}`,
|
|
@@ -230,7 +230,7 @@ function buildOption(zoomMode: 'initial' | 'keep' = 'initial') {
|
|
|
if (!data) return { animation: false }
|
|
if (!data) return { animation: false }
|
|
|
const measurementTypes = data.measurementTypes
|
|
const measurementTypes = data.measurementTypes
|
|
|
const periodBackground = periodAreas(data.cycles)
|
|
const periodBackground = periodAreas(data.cycles)
|
|
|
- const types = props.mode === 'merge' ? ['合并信号'] : [...measurementTypes, 'second_value', '角度', '体积']
|
|
|
|
|
|
|
+ const types = props.mode === 'merge' ? ['合并信号'] : [...measurementTypes, 'second_value', '体积']
|
|
|
const gridCount = types.length
|
|
const gridCount = types.length
|
|
|
const chartHeight = chartElement.value?.clientHeight || 640
|
|
const chartHeight = chartElement.value?.clientHeight || 640
|
|
|
const topInset = 32
|
|
const topInset = 32
|
|
@@ -278,9 +278,9 @@ function buildOption(zoomMode: 'initial' | 'keep' = 'initial') {
|
|
|
axisLabel: { color: '#71808a', fontSize: 11 },
|
|
axisLabel: { color: '#71808a', fontSize: 11 },
|
|
|
splitLine: { show: true, lineStyle: { color: '#e7edf0', width: 1 } },
|
|
splitLine: { show: true, lineStyle: { color: '#e7edf0', width: 1 } },
|
|
|
scale: type === '位移',
|
|
scale: type === '位移',
|
|
|
- min: type === '角度' ? 0 : fixed?.min,
|
|
|
|
|
- max: type === '角度' ? 180 : fixed?.max,
|
|
|
|
|
- interval: type === '角度' ? undefined : fixed?.interval,
|
|
|
|
|
|
|
+ min: fixed?.min,
|
|
|
|
|
+ max: fixed?.max,
|
|
|
|
|
+ interval: fixed?.interval,
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
const series: echarts.SeriesOption[] = []
|
|
const series: echarts.SeriesOption[] = []
|
|
@@ -324,18 +324,6 @@ function buildOption(zoomMode: 'initial' | 'keep' = 'initial') {
|
|
|
.filter((item) => Number.isFinite(item.x) && Number.isFinite(item.rawValue))
|
|
.filter((item) => Number.isFinite(item.x) && Number.isFinite(item.rawValue))
|
|
|
.map((item) => [item.x, (item.rawValue - secondMin) / secondSpan] as [number, number]),
|
|
.map((item) => [item.x, (item.rawValue - secondMin) / secondSpan] as [number, number]),
|
|
|
})
|
|
})
|
|
|
- series.push({
|
|
|
|
|
- name: '角度',
|
|
|
|
|
- type: 'line',
|
|
|
|
|
- xAxisIndex: 0,
|
|
|
|
|
- yAxisIndex: 0,
|
|
|
|
|
- showSymbol: false,
|
|
|
|
|
- lineStyle: { width: 1.5, type: 'dashed', color: colors['角度'], opacity: 0.8 },
|
|
|
|
|
- data: data.angleSeries.data
|
|
|
|
|
- .filter((item) => Number.isFinite(item.x) && Number.isFinite(item.angle))
|
|
|
|
|
- .map((item) => [item.x, item.angle / 180] as [number, number]),
|
|
|
|
|
- markLine: { silent: true, symbol: 'none', data: triggerLines(data.triggerXs) },
|
|
|
|
|
- })
|
|
|
|
|
const volumeValues = data.volumeSeries.data
|
|
const volumeValues = data.volumeSeries.data
|
|
|
const volumeFinite = volumeValues.map((item) => item.volume).filter(Number.isFinite)
|
|
const volumeFinite = volumeValues.map((item) => item.volume).filter(Number.isFinite)
|
|
|
const [volumeMin, volumeMax] = volumeFinite.length ? minMaxOf(volumeFinite) : [0, 1]
|
|
const [volumeMin, volumeMax] = volumeFinite.length ? minMaxOf(volumeFinite) : [0, 1]
|
|
@@ -353,8 +341,7 @@ function buildOption(zoomMode: 'initial' | 'keep' = 'initial') {
|
|
|
})
|
|
})
|
|
|
} else {
|
|
} else {
|
|
|
const secondIndex = measurementTypes.length
|
|
const secondIndex = measurementTypes.length
|
|
|
- const angleIndex = secondIndex + 1
|
|
|
|
|
- const volumeIndex = secondIndex + 2
|
|
|
|
|
|
|
+ const volumeIndex = secondIndex + 1
|
|
|
series.push({
|
|
series.push({
|
|
|
name: '周期数据',
|
|
name: '周期数据',
|
|
|
type: 'line',
|
|
type: 'line',
|
|
@@ -370,20 +357,6 @@ function buildOption(zoomMode: 'initial' | 'keep' = 'initial') {
|
|
|
.map((item) => [item.x, item.rawValue] as [number, number]),
|
|
.map((item) => [item.x, item.rawValue] as [number, number]),
|
|
|
markArea: { silent: true, data: periodBackground },
|
|
markArea: { silent: true, data: periodBackground },
|
|
|
})
|
|
})
|
|
|
- series.push({
|
|
|
|
|
- name: '角度',
|
|
|
|
|
- type: 'line',
|
|
|
|
|
- xAxisIndex: angleIndex,
|
|
|
|
|
- yAxisIndex: angleIndex,
|
|
|
|
|
- showSymbol: false,
|
|
|
|
|
- lineStyle: { width: 2, color: colors['角度'] },
|
|
|
|
|
- itemStyle: { color: colors['角度'] },
|
|
|
|
|
- data: data.angleSeries.data
|
|
|
|
|
- .filter((item) => Number.isFinite(item.x) && Number.isFinite(item.angle))
|
|
|
|
|
- .map((item) => [item.x, item.angle] as [number, number]),
|
|
|
|
|
- markArea: { silent: true, data: periodBackground },
|
|
|
|
|
- markLine: { silent: true, symbol: 'none', data: triggerLines(data.triggerXs) },
|
|
|
|
|
- })
|
|
|
|
|
series.push({
|
|
series.push({
|
|
|
name: '体积',
|
|
name: '体积',
|
|
|
type: 'line',
|
|
type: 'line',
|
|
@@ -448,7 +421,7 @@ function buildOption(zoomMode: 'initial' | 'keep' = 'initial') {
|
|
|
},
|
|
},
|
|
|
},
|
|
},
|
|
|
legend: {
|
|
legend: {
|
|
|
- data: [...measurementTypes, '周期数据', '角度', '体积'],
|
|
|
|
|
|
|
+ data: [...measurementTypes, '周期数据', '体积'],
|
|
|
top: 0,
|
|
top: 0,
|
|
|
left: 70,
|
|
left: 70,
|
|
|
itemWidth: 16,
|
|
itemWidth: 16,
|