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(v2-bullet): 修复legend错误 #1627

Merged
merged 1 commit into from
Sep 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/plots/bullet/adaptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,14 @@ function legend(params: Params<BulletOptions>): Params<BulletOptions> {
const { chart, options } = params;
const { legend } = options;
chart.removeInteraction('legend-filter');
// @TODO 后续看是否内部自定义一个 legend
chart.legend(legend);

// 默认关闭掉所在 color 字段的 legend, 从而不影响自定义的legend
chart.legend('rKey', false);
chart.legend('mKey', false);
chart.legend('tKey', false);

return params;
}

Expand Down
1 change: 0 additions & 1 deletion src/plots/bullet/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export class Bullet extends Plot<BulletOptions> {
protected getDefaultOptions() {
return deepMix({}, super.getDefaultOptions(), {
layout: 'horizontal',
legend: false, // 默认关掉
size: {
range: 30,
measure: 20,
Expand Down