longyvfengyun
2024-03-28 c9edc21dac11a334c1a49aec5cb829760def34c2
src/views/analysis/hdAnalysis.vue
@@ -7,6 +7,7 @@
import HdwChart from "@/components/echarts/hdwChart.vue";
import getNormalLine from "@/components/echarts/options/normalLine";
import {ElMessage} from "element-plus";
import getChartLinesMax from "@/util/getChartLinesMax";
const carName = ref("");
const timeRange = ref([]);
@@ -145,10 +146,13 @@
      // 图表3
      title3.value = data.y3Name;
      let chart3Data = formatData(data.bmsAlgorithmVoList3);
      chart3Option.xAxis.data = chart3Data.x;
      chart3Option.xAxis.data = chart3Data.x.map(item=>{
         return '#'+(item+1);
      });
      const chart3MaxInfo = getChartLinesMax(chart3Data.y);
      chart3Option.series = chart3Data.y.map((item, key)=>{
         return {
            name: '#'+(key+1),
            name: data.y3Name,
            type: 'line',
            sampling: "lttb",
            smooth: false,
@@ -156,8 +160,10 @@
            markPoint: {
               data: [
                  {
                     type: 'max',
                     name: 'Max',
                     name: "最大值",
                     value: "#"+(chart3MaxInfo.x+1),
                     xAxis: chart3Data.x[chart3MaxInfo.x],
                     yAxis: chart3MaxInfo.y,
                     itemStyle: {
                        color: '#ff0000'
                     }
@@ -183,10 +189,13 @@
      // 图表4
      title4.value = data.y4Name;
      let chart4Data = formatData(data.bmsAlgorithmVoList4);
      chart4Option.xAxis.data = chart4Data.x;
      chart4Option.xAxis.data = chart4Data.x.map(item=>{
         return '#'+(item+1);
      });
      const chart4MaxInfo = getChartLinesMax(chart4Data.y);
      chart4Option.series = chart4Data.y.map((item, key)=>{
         return {
            name: '#'+(key+1),
            name: data.y4Name,
            type: 'line',
            sampling: "lttb",
            smooth: false,
@@ -194,8 +203,10 @@
            markPoint: {
               data: [
                  {
                     type: 'max',
                     name: 'Max',
                     name: "最大值",
                     value: "#"+(chart4MaxInfo.x+1),
                     xAxis: chart4Data.x[chart4MaxInfo.x],
                     yAxis: chart4MaxInfo.y,
                     itemStyle: {
                        color: '#ff0000'
                     }
@@ -269,7 +280,7 @@
         containLabel: true
      }
   });
   chart3Option.tooltip.show = false;
   chart3Option.tooltip.show = true;
   chart3Option.xAxis.axisLabel.show = true;
   chart3Option.xAxis.axisLine.show = true;
@@ -284,7 +295,7 @@
         containLabel: true
      }
   });
   chart4Option.tooltip.show = false;
   chart4Option.tooltip.show = true;
   chart4Option.xAxis.axisLabel.show = true;
   chart4Option.xAxis.axisLine.show = true;
}