|
|
@ -189,13 +189,24 @@ export default { |
|
|
|
// 设置三个配置值 |
|
|
|
this.pieOption.title.text = pandectData.homeCount; |
|
|
|
this.pieData = [ |
|
|
|
{value: pandectData.selfStay, name: "自住房屋"}, |
|
|
|
{value: pandectData.rentOut, name: "出租房屋"}, |
|
|
|
{value: pandectData.vacantHouse, name: "闲置房屋"}, |
|
|
|
{value: pandectData.selfStay, name: "自住"}, |
|
|
|
{value: pandectData.rentOut, name: "出租"}, |
|
|
|
{value: pandectData.vacantHouse, name: "闲置"}, |
|
|
|
]; |
|
|
|
this.pieOption.series[0].data = this.pieData; |
|
|
|
console.log(this.pieOption, 'this.pieOption.series') |
|
|
|
this.$refs.pieChart.setOption(this.pieOption); |
|
|
|
//饼状图点击事件 |
|
|
|
this.$refs.pieChart.myChart.off('click').on('click', (param) =>{ //这里使用箭头函数代替function,this指向VueComponent |
|
|
|
let index; |
|
|
|
//当前扇区的dataIndex |
|
|
|
index = param.dataIndex; |
|
|
|
//自己的操作,这里是点击跳转路由,并携带参数 |
|
|
|
if (index !== undefined) { |
|
|
|
console.log(param) |
|
|
|
this.toListPage(index, param.name) |
|
|
|
} |
|
|
|
}); |
|
|
|
// this.$refs.pieChart.hideLoading() |
|
|
|
}, |
|
|
|
|
|
|
|