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

当data/options变更后图例的顺序出现异常 #6485

Open
CullenNg opened this issue Oct 9, 2024 · 0 comments
Open

当data/options变更后图例的顺序出现异常 #6485

CullenNg opened this issue Oct 9, 2024 · 0 comments

Comments

@CullenNg
Copy link

CullenNg commented Oct 9, 2024

问题描述

当data/options(scale)变更后图例的顺序出现了异常,scale.color.domain 配置的顺序失效

重现链接

https://codesandbox.io/p/sandbox/xmgl3j

重现步骤

  1. 正常加载数据A,此时的图例顺序是正常的
    image

  2. 切换成数据B并更新了scale.color配置,因为数据B只有1组数据,目前为止一切正常

scale: {
  color: {
    domain: ["无情感"],
    range: ["#65789B"],
  }
}

image

  1. 再切切回数据A并更新了scale.color配置,图例的顺序就错了
scale: {
  color: {
    domain: ["正面", "负面", "中性", "无情感"],
    range: ["#60DDA9", "#F08A8A", "#5B8FF9", "#65789B"],
  }
}

image
正确的顺序应该是如下:
image

预期行为

更新数据+options.scale之后的图例顺序正常
image

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox]

屏幕截图或视频(可选)

No response

补充说明(可选)

No response

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

1 participant