| | |
| | | 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([]); |
| | |
| | | // 图表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, |
| | |
| | | markPoint: { |
| | | data: [ |
| | | { |
| | | type: 'max', |
| | | name: 'Max', |
| | | name: "最大值", |
| | | value: "#"+(chart3MaxInfo.x+1), |
| | | xAxis: chart3Data.x[chart3MaxInfo.x], |
| | | yAxis: chart3MaxInfo.y, |
| | | itemStyle: { |
| | | color: '#ff0000' |
| | | } |
| | |
| | | // 图表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, |
| | |
| | | markPoint: { |
| | | data: [ |
| | | { |
| | | type: 'max', |
| | | name: 'Max', |
| | | name: "最大值", |
| | | value: "#"+(chart4MaxInfo.x+1), |
| | | xAxis: chart4Data.x[chart4MaxInfo.x], |
| | | yAxis: chart4MaxInfo.y, |
| | | itemStyle: { |
| | | color: '#ff0000' |
| | | } |
| | |
| | | containLabel: true |
| | | } |
| | | }); |
| | | chart3Option.tooltip.show = false; |
| | | chart3Option.tooltip.show = true; |
| | | chart3Option.xAxis.axisLabel.show = true; |
| | | chart3Option.xAxis.axisLine.show = true; |
| | | |
| | |
| | | containLabel: true |
| | | } |
| | | }); |
| | | chart4Option.tooltip.show = false; |
| | | chart4Option.tooltip.show = true; |
| | | chart4Option.xAxis.axisLabel.show = true; |
| | | chart4Option.xAxis.axisLine.show = true; |
| | | } |