|
@@ -33,27 +33,29 @@ export default {
|
|
|
methods: {
|
|
|
//次数分布折线图
|
|
|
initChart() {
|
|
|
+ var _this = this;
|
|
|
var chart = echarts.init(this.$refs.lineChart);
|
|
|
var option;
|
|
|
|
|
|
var timeLine = new Array();
|
|
|
- timeLine = this.ftrendIcoCount[0].listDate;
|
|
|
+ timeLine = this.ftrendIcoCount[0].listDate;
|
|
|
+ var time = this.$store.state.Time_Data;
|
|
|
+ this.$store.commit("getAll", [
|
|
|
+ time[0].split(" ")[0],
|
|
|
+ time[1].split(" ")[0],
|
|
|
+ ]); //将time变量中的开始时间和结束时间传给getAll方法
|
|
|
+ var timeall = this.$store.state.timearr; //将getAll已便利好的时间区间数组存入变量timeall
|
|
|
|
|
|
-
|
|
|
- // var arr = new Array();
|
|
|
- // for (var i = 0; i < 32; i++) {
|
|
|
- // timeLine.push(i);
|
|
|
- // }
|
|
|
-
|
|
|
- // if (this.ftrendIcoCount[0].listDate.length) {
|
|
|
- // console.log("有数据");
|
|
|
- // timeLine = this.ftrendIcoCount[0].listDate;
|
|
|
- // } else {
|
|
|
- // console.log("无数据");
|
|
|
- // for (var i = 0; i < 32; i++) {
|
|
|
- // timeLine.push(i);
|
|
|
- // }
|
|
|
- // }
|
|
|
+ if (this.ftrendIcoCount[0].listDate.length) {
|
|
|
+ timeLine = this.ftrendIcoCount[0].listDate;
|
|
|
+ } else {
|
|
|
+ timeLine = [parseInt(timeall[0].split("-")[2])];
|
|
|
+ timeLine.map(() => {
|
|
|
+ _this.ftrendIcoCount[0].list.push(0);
|
|
|
+ _this.ftrendIcoCount[1].list.push(0);
|
|
|
+ return;
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
option = {
|
|
|
color: ["#00F4FD", "#FD8F00"],
|