-
Notifications
You must be signed in to change notification settings - Fork 604
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
feat(scatter): 散点图支持color和shape同时映射图例字段 & 添加单测 #2406
Conversation
02b7604
to
f47bf6a
Compare
* feat(scatter): 散点图支持配置 shapeLegend & sizeLegend * test(scatter-legend): 增加散点图图例用例(shapeLegend、sizeLegend) Co-authored-by: visiky <736929286@qq.com> Co-authored-by: elvira.zy <elvira.zy@alibaba-inc.com>
默认配置 legend 时,展示 color 图例和 shape 图例 当 shapeLegend 为 false,强制关闭 shape 图例 shape 为 undefined 时,默认不会展示 shape 图例
本地 CI 已过 |
if (shapeLegend) { | ||
chart.legend(shapeField, shapeLegend); | ||
} else { | ||
chart.legend(shapeField, shapeLegend === false ? false : legend); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shapeLegend 为 undefined 的时候,showShapeLegend 为不显示,但这边却进到了 chart.legend(shapeField, legend); 的逻辑里。
- 其实不考虑兼容的话 chart.legend(shapeField, options.hasOwnProperty('shapeLegend') ? shapeLegend : legend) 就好了;
- 现在 colorField = undefined, legend = {} 的话,chart.legend() 没有一个函数能进,不确定对不对,感觉至少要触发 chart.legend(false)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
考虑兼容
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
“现在 colorField = undefined, legend = {} 的话,chart.legend() 没有一个函数能进” 不是的,可以看下使用文档
PR includes
Screenshot