流量走势
@@ -188,16 +176,22 @@
-
@@ -217,7 +211,7 @@ export default {
// 测试数据
test: {
a: "test",
- languages:[]
+ languages: [],
},
// 测试数据结束
tophotShopsColumns: [
@@ -418,6 +412,7 @@ export default {
let data = [...uv, ...pv];
+ console.log("pv", data);
this.pvChart.data(data);
this.pvChart.scale({
activeQuantity: {
@@ -491,13 +486,31 @@ export default {
initHistoryMemberChart() {
// 默认已经加载 legend-filter 交互
let data = this.chartList;
-
+ let num = [];
+ let lastNum = [];
data.forEach((item) => {
- item.title = "历史在线人数";
- item.date = item.date.substring(5);
- });
- this.historyMemberChart.data(data);
+ num.push({
+ date: item.date.substring(5),
+ title: "最近48小时",
+ num: item.num,
+ res: item.num,
+ });
+ lastNum.push({
+ date: item.date.substring(5),
+ title: "历史记录",
+ lastNum: item.lastNum || 0,
+ res: item.lastNum || 0,
+ });
+ });
+ let params = [...num, ...lastNum];
+ this.historyMemberChart.data(params);
+ this.historyMemberChart.scale({
+ activeQuantity: {
+ range: [0, 1],
+ nice: true,
+ },
+ });
this.historyMemberChart.tooltip({
showCrosshairs: true,
shared: true,
@@ -505,14 +518,15 @@ export default {
this.historyMemberChart
.line()
- .position("date*num")
- .color("title", ["#ffaa71"])
+ .position("date*res")
+ .color("title", ["#ffaa71", "#398AB9"])
+ .label("res")
.shape("smooth");
-
this.historyMemberChart
.point()
- .position("date*num")
- .color("title", ["#ffaa71"])
+ .position("date*res")
+ .color("title", ["#ffaa71", "#398AB9"])
+ .label("res")
.shape("circle");
this.historyMemberChart.render();
},