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

无数据时,设置 meta,再 changeData 会导致图例展示错误 #3738

Closed
visiky opened this issue Dec 12, 2021 · 1 comment
Closed

Comments

@visiky
Copy link
Member

visiky commented Dec 12, 2021

估计是 scale 根据 data 来判断字段类型,无数据时,把 color 通道的字段当作为 数值型的了。需要手动指定 type: 'cat'

复现demo:https://codesandbox.io/s/scale-dao-zhi-tu-li-zhan-shi-cuo-wu-n7km9

@hustcc
Copy link
Member

hustcc commented Dec 6, 2022

chart.scale('city', { type: 'cat' });

看了代码,👆🏻可能是最好解决办法,scale 创建逻辑是首次创建之后,后续都不会根据数据来进行自动处理,除非手动设置。

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