Commit cb9ea368 authored by Damon's avatar Damon

refactor: 图表数据

parent a597b6ff
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
background="none" background="none"
:opts="{ :opts="{
enableScroll: true, enableScroll: true,
xAxis: { scrollShow: true, itemCount: 4, disableGrid: true }, xAxis: { enableScroll:true, scrollShow: true, itemCount: 3, disableGrid: true, boundaryGap: 'center'},
}" }"
:ontouch="true" :ontouch="true"
:disableScroll="true" :disableScroll="true"
...@@ -230,10 +230,19 @@ export default { ...@@ -230,10 +230,19 @@ export default {
this.chartData.series[0].data = [] this.chartData.series[0].data = []
this.chartData.series[1].data = [] this.chartData.series[1].data = []
this.chartData.categories = [] this.chartData.categories = []
for (var item in res) {
this.chartData.categories.push(item.replace(/\-/g, '.')) let keys = []
this.chartData.series[0].data.push(res[item].totalCount) Object.keys(res).forEach(v => {
this.chartData.series[1].data.push(res[item].rightCount) keys.push(v)
})
keys.sort()
for (let index = 0; index < keys.length; index++) {
const ele = keys[index]
console.log("ele", ele)
this.chartData.categories.push(ele.replace(/\-/g, '.'))
this.chartData.series[0].data.push(res[ele].totalCount)
this.chartData.series[1].data.push(res[ele].rightCount)
} }
}) })
.catch((err) => { .catch((err) => {
......
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