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

fix: 双轴图 theme 主题设置 #2451

Merged
merged 1 commit into from
Mar 24, 2021
Merged

fix: 双轴图 theme 主题设置 #2451

merged 1 commit into from
Mar 24, 2021

Conversation

liuzhenying
Copy link
Member

PR includes

  • fixed #0
  • add / modify test cases
  • documents, demos

Screenshot

Before After
屏幕快照 2021-03-23 11 32 51 屏幕快照 2021-03-23 11 32 34
解读: 修复双轴图主题设置中坐标轴不生效的问题

* 双轴图中,部分组件是绘制在子 view 层(例如 axis,line),部分组件是绘制在 chart (例如 legend)
* 为 chart 和 子 view 均注册 theme,使其自行遵循 G2 theme geometry > view > chart 进行渲染。
*/
commonTheme(deepAssign({}, params, { chart: findViewById(chart, LEFT_AXES_VIEW) }));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里有一个小小的隐患就是,view 会不会不存在

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个只要 g2 能正常创建出来,就会存在,反过来说,如果 view 没创建成功,整个 adaptor 里都得做层判断,感觉只在这个函数里判断意义不是很大:)

@visiky visiky merged commit 69bf536 into master Mar 24, 2021
@visiky visiky deleted the fix/duax_theme_axis branch March 24, 2021 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants