Skip to content

Commit 578610c

Browse files
authored
fix: 修复legend错误 (#1627)
1 parent 157f9ce commit 578610c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/plots/bullet/adaptor.ts

+6
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,14 @@ function legend(params: Params<BulletOptions>): Params<BulletOptions> {
148148
const { chart, options } = params;
149149
const { legend } = options;
150150
chart.removeInteraction('legend-filter');
151+
// @TODO 后续看是否内部自定义一个 legend
151152
chart.legend(legend);
152153

154+
// 默认关闭掉所在 color 字段的 legend, 从而不影响自定义的legend
155+
chart.legend('rKey', false);
156+
chart.legend('mKey', false);
157+
chart.legend('tKey', false);
158+
153159
return params;
154160
}
155161

src/plots/bullet/index.ts

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export class Bullet extends Plot<BulletOptions> {
2020
protected getDefaultOptions() {
2121
return deepMix({}, super.getDefaultOptions(), {
2222
layout: 'horizontal',
23-
legend: false, // 默认关掉
2423
size: {
2524
range: 30,
2625
measure: 20,

0 commit comments

Comments
 (0)