Commit d2bbbf87 authored by wends's avatar wends

update line chart component

parent 49fb1677
......@@ -45,6 +45,10 @@ export default {
default: () => {
return {}
}
},
format: {
type: String,
default: 'HH:mm:ss'
}
},
data() {
......@@ -72,10 +76,14 @@ export default {
const xAxis = []
const series = []
data.forEach(v => {
xAxis.push(moment(v.time).format('HH:mm:ss'))
xAxis.push(moment(v.time).format(this.format))
series.push(v.value)
})
this.chart.setOption({
title: {
text: `${this.title}监控图表`,
subtext: `单位为: ${this.description}`
},
xAxis: {
data: xAxis
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment