Replies: 1 comment
-
不没有 legend 不会去监听 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
问题描述
`import { Chart } from '@antv/g2';
const chart = new Chart({ container: 'container' });
chart
.interval()
.data([
{ genre: 'Sports', sold: 0 },
{ genre: 'Strategy', sold: 115 },
{ genre: 'Action', sold: 120 },
{ genre: 'Shooter', sold: 350 },
{ genre: 'Other', sold: 150 },
])
.encode('x', 'genre')
.encode('y', 'sold')
.encode('color', 'genre')
.style('minHeight', 50)
.legend(false)
chart.render()
setTimeout(()=>{
console.log('test')
chart.emit('legend:filter', {
data: { channel: 'color', values: ['Sports', 'Strategy'] },
});
}, 2000)
`
重现链接
No response
重现步骤
chart
.legend(false)
希望也外部控制 legend:filter 事件触发
预期行为
No response
平台
屏幕截图或视频(可选)
No response
补充说明(可选)
No response
Beta Was this translation helpful? Give feedback.
All reactions