Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chart设置filterData不生效 #3727

Closed
1 task
xiangchunyu opened this issue Nov 26, 2021 · 12 comments
Closed
1 task

chart设置filterData不生效 #3727

xiangchunyu opened this issue Nov 26, 2021 · 12 comments

Comments

@xiangchunyu
Copy link

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

Edit on CodeSandbox

Steps to reproduce

点击interval使用filterData过滤新数据,预期展示新的过滤数据,但未达到预期

Environment Info
g2 4.1.34
System -
Browser -

使用filter可以正常过滤

@hustcc
Copy link
Member

hustcc commented Nov 29, 2021

没有 filterData 这个 api 把~

@xiangchunyu
Copy link
Author

xiangchunyu commented Nov 29, 2021

文档上是有这个api的呀 https://g2-v4.antv.vision/zh/docs/api/general/chart#viewfilterdata 麻烦再看一下?是用法不对么

@xiangchunyu
Copy link
Author

试了一下没有的api是直接会报错的,但是使用filterData没有报错,只是不生效

@hustcc
Copy link
Member

hustcc commented Nov 29, 2021

这个算是一个内部方法吧,你直接使用 filter 方法吧~

@xiangchunyu
Copy link
Author

额 但是filter对我的场景不适用,我这边还是需要使用filterData,可以把filterData暴露一下么像filter一样

@hustcc
Copy link
Member

hustcc commented Nov 29, 2021

可以描述下你的场景嘛?我帮你看看怎么做比较合适~

@xiangchunyu
Copy link
Author

想默认展示数据里面的某一批数据,这批数据是直接给好的,用filter不好设置过滤规则,但是用filterData就可以直接设置这批数据了

@hustcc
Copy link
Member

hustcc commented Nov 29, 2021

那就用 changeData 这个 API 了。直接改变数据就可以了。

@xiangchunyu
Copy link
Author

试过changeData这个api 这个应该是重置整个data了 但想要的效果不是这样的 changeData改变数据源后没有展示出来的数据的图例也都没了 但是是想没有展示出来的图例是置灰的这种

@hustcc
Copy link
Member

hustcc commented Nov 29, 2021

要不贴一下 filter 前和后的数据。不知道为啥 filter api 没法满足?

@xiangchunyu
Copy link
Author

嗯嗯 这边要是不会开放filterData api的话 我这边再看下吧 使用filter也可以 不过你们文档如果不支持这个api感觉可以下掉 看文档比较有误导性 谢谢~

@hustcc
Copy link
Member

hustcc commented Dec 6, 2022

文档已移除!

@hustcc hustcc closed this as completed Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants