修改图表

master
夜笙歌 2 years ago
parent ecc43e335a
commit 3dde34def2

@ -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

Loading…
Cancel
Save