Commit 3e0e90bb by 匡雅琴

柱状图显示调通

1 parent 5753b7e5
......@@ -124,10 +124,12 @@ export default {
this.orderNum = _data.orderNum
this.activityNum = _data.activityNum
this.dataList.amountDataList = _data.trend
console.log(this.dataList.amountDataList);
this.$refs.amountChartRef.drawBar()
this.$refs.sessionChartRef.drawBar()
this.$refs.outputChartRef.drawBar()
console.log(this.dataList.amountDataList)
this.$nextTick(() => {
this.$refs.amountChartRef.drawBar()
this.$refs.sessionChartRef.drawBar()
this.$refs.outputChartRef.drawBar()
})
}
}
}
......
......@@ -9,7 +9,17 @@
<template>
<div class="activity-box">
<box-title title="近一年活动场次趋势图"></box-title>
<BarChart ref="activityTrendChartRef" class="bar-chart" isMultiple :barWidth="'24'" domId="activityTrendChart" height="26.22vh" :dataList.sync="dataList" :colorList="colorList" :tooltipFormatterObj="tooltips.amountTooltip"></BarChart>
<BarChart
ref="activityTrendChartRef"
class="bar-chart"
isMultiple
:barWidth="'24'"
domId="activityTrendChart"
height="26.22vh"
:dataList.sync="dataList"
:colorList="colorList"
:tooltipFormatterObj="tooltips.amountTooltip"
></BarChart>
</div>
</template>
......@@ -36,11 +46,12 @@ export default {
}
},
created() {
this.getActivityTrend()
// this.getActivityTrend()
},
mounted() {
// this.$refs.activityTrendChartRef.drawBar()
this.getActivityTrend()
},
methods: {
......@@ -49,7 +60,9 @@ export default {
console.log(_result)
const _data = _result.data.dataList
this.dataList = _data
this.$refs.activityTrendChartRef.drawBar()
this.$nextTick(() => {
this.$refs.activityTrendChartRef.drawBar()
})
}
}
}
......
......@@ -73,7 +73,7 @@ export default {
},
drawBar() {
console.log(this.dataList, this.tooltipFormatterObj)
this.barOptions.xAxis.data = this.dataList.map(item => item.month)
this.barOptions.xAxis.data = this.dataList.map(item => item.statMonth)
this.barOptions.series[0].data = this.dataList.map(item => item[this.tooltipFormatterObj.attrName])
this[this.domId].setOption(this.barOptions)
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!