|
@@ -75,7 +75,13 @@
|
|
</el-button>
|
|
</el-button>
|
|
</el-button-group>
|
|
</el-button-group>
|
|
</div>
|
|
</div>
|
|
- <canvas id="barChart" v-if="heightBar > 0" :height="heightBar" style="width: 100%" class=""></canvas>
|
|
|
|
|
|
+ <canvas
|
|
|
|
+ id="barChart"
|
|
|
|
+ v-if="heightBar > 0"
|
|
|
|
+ :height="heightBar"
|
|
|
|
+ style="width: 100%"
|
|
|
|
+ class=""
|
|
|
|
+ ></canvas>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="card">
|
|
<div class="card">
|
|
@@ -197,7 +203,7 @@ export default {
|
|
usertotal: 0,
|
|
usertotal: 0,
|
|
height: 0,
|
|
height: 0,
|
|
c: ["#FB6161", "#EC72DC", "#F98E53", "#49BED0", "#4BCA8B"],
|
|
c: ["#FB6161", "#EC72DC", "#F98E53", "#49BED0", "#4BCA8B"],
|
|
- heightBar: 0
|
|
|
|
|
|
+ heightBar: 0,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
filters: {
|
|
filters: {
|
|
@@ -340,10 +346,9 @@ export default {
|
|
title: this.topic,
|
|
title: this.topic,
|
|
}).then(r => {
|
|
}).then(r => {
|
|
let li = (r || []).reverse();
|
|
let li = (r || []).reverse();
|
|
- console.log(li)
|
|
|
|
this.heightBar = li.length ? li.length * 35 + 40 : 0;
|
|
this.heightBar = li.length ? li.length * 35 + 40 : 0;
|
|
localStorage.type = this.type;
|
|
localStorage.type = this.type;
|
|
- if(this.heightBar === 0) return
|
|
|
|
|
|
+ if (this.heightBar === 0) return;
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
this.bar1(li);
|
|
this.bar1(li);
|
|
});
|
|
});
|
|
@@ -370,12 +375,23 @@ export default {
|
|
});
|
|
});
|
|
linechart.source(li, {
|
|
linechart.source(li, {
|
|
dt: {
|
|
dt: {
|
|
- tickCount: 3,
|
|
|
|
|
|
+ tickCount: 5,
|
|
},
|
|
},
|
|
playCount: {
|
|
playCount: {
|
|
tickCount: 5,
|
|
tickCount: 5,
|
|
},
|
|
},
|
|
});
|
|
});
|
|
|
|
+ linechart.axis("dt", {
|
|
|
|
+ label: function label(text, index, total) {
|
|
|
|
+ const textCfg = {};
|
|
|
|
+ if (index === 0) {
|
|
|
|
+ textCfg.textAlign = "left";
|
|
|
|
+ } else if (index === total - 1) {
|
|
|
|
+ textCfg.textAlign = "right";
|
|
|
|
+ }
|
|
|
|
+ return textCfg;
|
|
|
|
+ },
|
|
|
|
+ });
|
|
linechart.scale("playCount", {
|
|
linechart.scale("playCount", {
|
|
formatter(text) {
|
|
formatter(text) {
|
|
return that.numform(text);
|
|
return that.numform(text);
|
|
@@ -416,7 +432,7 @@ export default {
|
|
id: "barChart",
|
|
id: "barChart",
|
|
pixelRatio: window.devicePixelRatio,
|
|
pixelRatio: window.devicePixelRatio,
|
|
padding: [10, 50, 30, 140],
|
|
padding: [10, 50, 30, 140],
|
|
- height: this.heightBar
|
|
|
|
|
|
+ height: this.heightBar,
|
|
});
|
|
});
|
|
|
|
|
|
barchart.source(li, {
|
|
barchart.source(li, {
|