微信统计
This commit is contained in:
@@ -78,10 +78,6 @@ export default {
|
|||||||
created() {
|
created() {
|
||||||
this.getData()
|
this.getData()
|
||||||
},
|
},
|
||||||
mounted() {
|
|
||||||
this.getFriendsEcharts()
|
|
||||||
this.getGroupsEcharts()
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
getData() {
|
getData() {
|
||||||
// 居民好友
|
// 居民好友
|
||||||
@@ -91,6 +87,7 @@ export default {
|
|||||||
this.friendsData = res.data.居民好友数
|
this.friendsData = res.data.居民好友数
|
||||||
this.friendsMonth = this.friendsData.map(e=> e.month)
|
this.friendsMonth = this.friendsData.map(e=> e.month)
|
||||||
this.friendsNumber = this.friendsData.map(e=> e.totalNumber)
|
this.friendsNumber = this.friendsData.map(e=> e.totalNumber)
|
||||||
|
this.getFriendsEcharts(this.friendsMonth,this.friendsNumber)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// 居民群
|
// 居民群
|
||||||
@@ -100,19 +97,20 @@ export default {
|
|||||||
this.groupsData = res.data.群成员数
|
this.groupsData = res.data.群成员数
|
||||||
this.groupsMonth = this.groupsData.map(e=> e.month)
|
this.groupsMonth = this.groupsData.map(e=> e.month)
|
||||||
this.groupsNumber = this.groupsData.map(e=> e.totalNumber)
|
this.groupsNumber = this.groupsData.map(e=> e.totalNumber)
|
||||||
|
this.getGroupsEcharts(this.groupsMonth,this.groupsNumber)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getFriendsEcharts() {
|
getFriendsEcharts(friendsMonth,friendsNumber) {
|
||||||
let friendsDom = document.getElementById('friends');
|
let friendsDom = document.getElementById('friends');
|
||||||
let myChart = echarts.init(friendsDom);
|
let myFriendsChart = echarts.init(friendsDom);
|
||||||
let option = {
|
let option = {
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: "axis",
|
trigger: "axis",
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'category',
|
type: 'category',
|
||||||
data: this.friendsMonth,
|
data: friendsMonth,
|
||||||
axisTick: {
|
axisTick: {
|
||||||
show: false,
|
show: false,
|
||||||
}
|
}
|
||||||
@@ -128,7 +126,7 @@ export default {
|
|||||||
},
|
},
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
data: this.friendsNumber,
|
data: friendsNumber,
|
||||||
type: 'line',
|
type: 'line',
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: '#3975C6', // 折线线条颜色
|
color: '#3975C6', // 折线线条颜色
|
||||||
@@ -159,18 +157,18 @@ export default {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
option && myChart.setOption(option);
|
option && myFriendsChart.setOption(option);
|
||||||
},
|
},
|
||||||
getGroupsEcharts() {
|
getGroupsEcharts(groupsMonth,groupsNumber) {
|
||||||
let groupsDom = document.getElementById('groups');
|
let groupsDom = document.getElementById('groups');
|
||||||
let myChart = echarts.init(groupsDom);
|
let myGroupsChart = echarts.init(groupsDom);
|
||||||
let option = {
|
let option = {
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: "axis",
|
trigger: "axis",
|
||||||
},
|
},
|
||||||
xAxis: {
|
xAxis: {
|
||||||
type: 'category',
|
type: 'category',
|
||||||
data: this.groupsMonth,
|
data: groupsMonth,
|
||||||
axisTick: {
|
axisTick: {
|
||||||
show: false,
|
show: false,
|
||||||
}
|
}
|
||||||
@@ -186,7 +184,7 @@ export default {
|
|||||||
},
|
},
|
||||||
series: [
|
series: [
|
||||||
{
|
{
|
||||||
data: this.groupsNumber,
|
data: groupsNumber,
|
||||||
type: 'line',
|
type: 'line',
|
||||||
lineStyle: {
|
lineStyle: {
|
||||||
color: '#3975C6', // 折线线条颜色
|
color: '#3975C6', // 折线线条颜色
|
||||||
@@ -217,7 +215,7 @@ export default {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
option && myChart.setOption(option);
|
option && myGroupsChart.setOption(option);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user