Commit a77d24bd by 姜雷

修改每月注册数据的点击监听

parent a441ba89
...@@ -45,19 +45,12 @@ export default { ...@@ -45,19 +45,12 @@ export default {
showTitle: false, showTitle: false,
}); });
// 图例 // 图例
this.chart.legend({ this.chart
.legend({
position: 'top', position: 'top',
title: null, title: null,
marker: 'square', marker: 'square',
}); })
// .axis('count', false)
// .axis('mark', {
// formatter: value => {
// let service = this.serviceList.find(item => item.value === value);
// return service ? `${service.name}` : '';
// },
// });
this.chart
.interval() .interval()
.position('month*count') .position('month*count')
.color('mark', ['#4e82fb', '#ffc934', '#26c9a8']) .color('mark', ['#4e82fb', '#ffc934', '#26c9a8'])
......
...@@ -52,11 +52,14 @@ export default { ...@@ -52,11 +52,14 @@ export default {
.position('month*count') .position('month*count')
.color('#4e82fb'); .color('#4e82fb');
this.chart.render(); this.chart.render();
this.chart.on('interval:click', this.clickHandle); this.chart.on('plotclick', this.clickHandle);
}, },
clickHandle(ev) { clickHandle(ev) {
let data = ev.data._origin; let records = this.chart.getSnapRecords({ x: ev.x, y: ev.y });
if (records && records.length) {
let data = records[0]._origin;
this.changeReportMonthHandle(data.month); this.changeReportMonthHandle(data.month);
}
}, },
}, },
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment