From 3dde34def25f9e065ae39c4c1fbdce49a5dfe839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9C=E7=AC=99=E6=AD=8C?= <2277317060@qq.com> Date: Thu, 30 Mar 2023 15:43:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9B=BE=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/src/views/dashboard/Temp.vue | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ruoyi-ui/src/views/dashboard/Temp.vue b/ruoyi-ui/src/views/dashboard/Temp.vue index cc4a1fa..5f53424 100644 --- a/ruoyi-ui/src/views/dashboard/Temp.vue +++ b/ruoyi-ui/src/views/dashboard/Temp.vue @@ -64,7 +64,7 @@ export default defineComponent({ textStyle: { color: '#000' }, - interval: 0, //显示所有X轴信息 + // interval: 0, //显示所有X轴信息 rotate: -40 //倾斜角度 }, data: [] @@ -175,15 +175,19 @@ export default defineComponent({ const initeCharts = () => { let myChart = echarts.init(document.getElementById('myChart')) // 绘制图表 - console.log(state.option) myChart.setOption(state.option) } const setData = (e) => { - let X = e.SpeedList.map(v => v.time) - let Y1 = e.SpeedList.map(v => v.speed) + let X = e.TPList.map(v => v.time) + let Y1 = [] let Y2 = e.TPList.map(v => v.temperature) let Y3 = e.TPList.map(v => v.press) const {option} = toRefs(state) + X.forEach(res => { + Y1.push(e.SpeedList.find(v => v.time === res)?.speed || 0) + }) + console.log(X) + console.log(Y1) option.value.xAxis.data = X option.value.series[0].data = Y1 option.value.series[1].data = Y2