Commit cb9ea368 authored by Damon's avatar Damon

refactor: 图表数据

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