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

🐛 [BUG] 图例显示错误 #2952

Closed
asurance opened this issue Nov 1, 2021 · 1 comment
Closed

🐛 [BUG] 图例显示错误 #2952

asurance opened this issue Nov 1, 2021 · 1 comment
Labels
Bug Something isn't working

Comments

@asurance
Copy link

asurance commented Nov 1, 2021

🐛 Bug description [Please make everyone to understand it]

在使用多折线图时配置seriesField的formatter后,先渲染空数据,然后使用changedata给出实际的数据,则图例一直显示异常,如果一开始就有数据的话,则图例一直显示正常

Please provide a link by forking these links G2Plot or GitHub repo, a minimal reproduction.

codesandbox

  • Required Link to minimal reproduction:

📷 Step to reproduce

如codesandbox中效果,如果将代码中的注释解除,则图例显示正常

🏞 Expected result

图例之后能正常显示

🚑 Any additional [like screenshots]

  • G2Plot Version: 2.3.39
  • Platform: codesandbox
@visiky
Copy link
Member

visiky commented Dec 12, 2021

see: antvis/G2#3738

目前解决方案如下:

 category: {
      type: 'cat', // 声明为分类字段
      formatter(val) {
        return val;
      }
    }

@visiky visiky closed this as completed Dec 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants