antvis/G2

The issue has been closed
当data/options变更后图例的顺序出现异常 #6485
CullenNg posted onGitHub
问题描述
当data/options(scale)变更后图例的顺序出现了异常,scale.color.domain 配置的顺序失效
重现链接
https://codesandbox.io/p/sandbox/xmgl3j
重现步骤
正常加载数据A,此时的图例顺序是正常的
切换成数据B并更新了scale.color配置,因为数据B只有1组数据,目前为止一切正常
scale: { color: { domain: ["无情感"], range: ["#65789B"], } }
再切切回数据A并更新了scale.color配置,图例的顺序就错了
scale: { color: { domain: ["正面", "负面", "中性", "无情感"], range: ["#60DDA9", "#F08A8A", "#5B8FF9", "#65789B"], } }
正确的顺序应该是如下:
预期行为
更新数据+options.scale之后的图例顺序正常
平台
- 操作系统: [macOS, Windows, Linux, React Native ...]
- 网页浏览器: [Google Chrome, Safari, Firefox]
屏幕截图或视频(可选)
No response
补充说明(可选)
No response