Skip to content

【丰富 Legend 交互】原:Legend支持selectedMode吗? #2330

Answered by visiky
jlongguo asked this question in Q&A
Discussion options

You must be logged in to vote

1⃣️ legend 支持单选交互,见: antvis/G2#3289 使用方式

2⃣️ 问题

Q:多折线图,如何在初始化时指定隐藏折线?触发点击legend的隐藏?
A:手动在 plot 渲染之后,调用 g2 chart 的 filter 方法,如下:

plot.chart.filter('area', area => area !== '华北')

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by visiky
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1163 on February 15, 2021 12:28.