Преглед на файлове

Remove angle grid from split view and angle curve from merged view

18922397810 преди 1 седмица
родител
ревизия
613b5e0d4b
променени са 1 файла, в които са добавени 7 реда и са изтрити 34 реда
  1. 7 34
      frontend/src/components/WaveChart.vue

+ 7 - 34
frontend/src/components/WaveChart.vue

@@ -150,7 +150,7 @@ function annotationAreas(annotations: Annotation[]): any[] {
 function buildAnnotationOverlaySeries(annotations: Annotation[]): echarts.SeriesOption[] {
   const data = props.data
   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)
   return Array.from({ length: gridCount }, (_, index) => ({
     id: `annotation-overlay-${index}`,
@@ -230,7 +230,7 @@ function buildOption(zoomMode: 'initial' | 'keep' = 'initial') {
   if (!data) return { animation: false }
   const measurementTypes = data.measurementTypes
   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 chartHeight = chartElement.value?.clientHeight || 640
   const topInset = 32
@@ -278,9 +278,9 @@ function buildOption(zoomMode: 'initial' | 'keep' = 'initial') {
       axisLabel: { color: '#71808a', fontSize: 11 },
       splitLine: { show: true, lineStyle: { color: '#e7edf0', width: 1 } },
       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[] = []
@@ -324,18 +324,6 @@ function buildOption(zoomMode: 'initial' | 'keep' = 'initial') {
         .filter((item) => Number.isFinite(item.x) && Number.isFinite(item.rawValue))
         .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 volumeFinite = volumeValues.map((item) => item.volume).filter(Number.isFinite)
     const [volumeMin, volumeMax] = volumeFinite.length ? minMaxOf(volumeFinite) : [0, 1]
@@ -353,8 +341,7 @@ function buildOption(zoomMode: 'initial' | 'keep' = 'initial') {
     })
   } else {
     const secondIndex = measurementTypes.length
-    const angleIndex = secondIndex + 1
-    const volumeIndex = secondIndex + 2
+    const volumeIndex = secondIndex + 1
     series.push({
       name: '周期数据',
       type: 'line',
@@ -370,20 +357,6 @@ function buildOption(zoomMode: 'initial' | 'keep' = 'initial') {
         .map((item) => [item.x, item.rawValue] as [number, number]),
       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({
       name: '体积',
       type: 'line',
@@ -448,7 +421,7 @@ function buildOption(zoomMode: 'initial' | 'keep' = 'initial') {
       },
     },
     legend: {
-      data: [...measurementTypes, '周期数据', '角度', '体积'],
+      data: [...measurementTypes, '周期数据', '体积'],
       top: 0,
       left: 70,
       itemWidth: 16,