Commit 3e0e90bb by 匡雅琴

柱状图显示调通

1 parent 5753b7e5
...@@ -124,10 +124,12 @@ export default { ...@@ -124,10 +124,12 @@ export default {
this.orderNum = _data.orderNum this.orderNum = _data.orderNum
this.activityNum = _data.activityNum this.activityNum = _data.activityNum
this.dataList.amountDataList = _data.trend this.dataList.amountDataList = _data.trend
console.log(this.dataList.amountDataList); console.log(this.dataList.amountDataList)
this.$nextTick(() => {
this.$refs.amountChartRef.drawBar() this.$refs.amountChartRef.drawBar()
this.$refs.sessionChartRef.drawBar() this.$refs.sessionChartRef.drawBar()
this.$refs.outputChartRef.drawBar() this.$refs.outputChartRef.drawBar()
})
} }
} }
} }
......
...@@ -9,7 +9,17 @@ ...@@ -9,7 +9,17 @@
<template> <template>
<div class="activity-box"> <div class="activity-box">
<box-title title="近一年活动场次趋势图"></box-title> <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> </div>
</template> </template>
...@@ -36,11 +46,12 @@ export default { ...@@ -36,11 +46,12 @@ export default {
} }
}, },
created() { created() {
this.getActivityTrend() // this.getActivityTrend()
}, },
mounted() { mounted() {
// this.$refs.activityTrendChartRef.drawBar() // this.$refs.activityTrendChartRef.drawBar()
this.getActivityTrend()
}, },
methods: { methods: {
...@@ -49,7 +60,9 @@ export default { ...@@ -49,7 +60,9 @@ export default {
console.log(_result) console.log(_result)
const _data = _result.data.dataList const _data = _result.data.dataList
this.dataList = _data this.dataList = _data
this.$nextTick(() => {
this.$refs.activityTrendChartRef.drawBar() this.$refs.activityTrendChartRef.drawBar()
})
} }
} }
} }
......
...@@ -73,7 +73,7 @@ export default { ...@@ -73,7 +73,7 @@ export default {
}, },
drawBar() { drawBar() {
console.log(this.dataList, this.tooltipFormatterObj) 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.barOptions.series[0].data = this.dataList.map(item => item[this.tooltipFormatterObj.attrName])
this[this.domId].setOption(this.barOptions) 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!