Skip to content

fix(dualaxes): configure legend selected #2784

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

Merged
merged 2 commits into from
Aug 11, 2021

Conversation

Shamann
Copy link
Contributor

@Shamann Shamann commented Aug 10, 2021

PR includes

Screenshot

Before After
dualaxes-before dualaxes-after

@Shamann Shamann changed the title Fix/dualaxes legend selected fix(dualaxes): configure legend selected Aug 10, 2021
@visiky visiky requested a review from liuzhenying August 11, 2021 03:40
if (geometryOptions[1].seriesField) {
rightView.legend(geometryOptions[1].seriesField, legend);
}

Copy link
Contributor

Choose a reason for hiding this comment

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

src\plots\dual-axes\util\legend.ts
image
加到这里也可以,就不用判断了。

@liuzhenying
Copy link
Member

@visiky 我这边看着应该没什么问题,看测试用例也都跑通了

@liuzhenying
Copy link
Member

不过补充一点,在双轴图图例里很麻烦的一点是将左右view没有拆分字段的,和左右view中有拆分字段的行为统一起来。
例如: https://g2plot.antv.vision/zh/examples/dual-axes/column-line#column-line
从数据和 g2 的角度,很容易理解这个 case 没有拆分字段,也不会有类似于 legend select 的能力,但从我答疑的情况看,很多人会不太能意识到其中的数据区别,可能会问是否可以默认只显示 value,或 count 之类的
可以等具体遇到了再说~

@visiky visiky merged commit 25fbe90 into antvis:master Aug 11, 2021
@Shamann Shamann deleted the fix/dualaxes-legend-selected branch August 11, 2021 11:19
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.

🐛 [BUG] Legend's selected option doesn't work on DualAxes chart
4 participants