From 73e6b862f422fb2b53e2ac0c96f9b1b37a0ae711 Mon Sep 17 00:00:00 2001 From: Ryan Zhang Date: Wed, 24 Apr 2024 11:36:14 +0800 Subject: [PATCH] =?UTF-8?q?fix(master):=20=E4=B8=8D=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E9=BB=98=E8=AE=A4legend=20(#388)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Zhang Rui --- src/area/framework.ts | 1 + src/bar/framework.ts | 1 + src/box/framework.ts | 1 + src/bubble/framework.ts | 1 + src/column/framework.ts | 2 ++ src/donut/framework.ts | 1 + src/double-axes/framework.ts | 1 + 7 files changed, 8 insertions(+) diff --git a/src/area/framework.ts b/src/area/framework.ts index 9816b1c8..0cd93e7f 100644 --- a/src/area/framework.ts +++ b/src/area/framework.ts @@ -57,6 +57,7 @@ export class Area extends BaseChart { this.instance.interaction('element-highlight-by-color'); this.instance.render(); // like Line framework, render twice to fix wrong label issue. + this.instance.legend(false); this.instance.render(true); } catch (err) { /* istanbul ignore next */ diff --git a/src/bar/framework.ts b/src/bar/framework.ts index a9d9ea4f..53f48c82 100644 --- a/src/bar/framework.ts +++ b/src/bar/framework.ts @@ -186,6 +186,7 @@ export class TimeBar extends Bar { leadView.render(); textView.render(); fetchTooltip(this.instance, config); + this.instance.legend(false); this.instance.render(); }; } diff --git a/src/box/framework.ts b/src/box/framework.ts index 736e5413..6afce09b 100644 --- a/src/box/framework.ts +++ b/src/box/framework.ts @@ -82,6 +82,7 @@ export class Box extends BaseChart { this.options = options; this.config = config; this.views = [boxView]; + this.instance.legend(false); return { chart, views: [boxView], update: this.update }; }; diff --git a/src/bubble/framework.ts b/src/bubble/framework.ts index 9785a109..aa416773 100644 --- a/src/bubble/framework.ts +++ b/src/bubble/framework.ts @@ -34,6 +34,7 @@ export class Bubble extends BaseChart { fetchTooltip(this.instance, config); this.instance.interaction('element-highlight'); + this.instance.legend(false); // this.instance.interaction('brush'); this.instance.render(); }; diff --git a/src/column/framework.ts b/src/column/framework.ts index 7e196d93..24ee8423 100644 --- a/src/column/framework.ts +++ b/src/column/framework.ts @@ -70,6 +70,7 @@ export const intervalShape = ( } interval.state(getShapeState(options)); interval.customInfo(setCustomInfo(options, config, customInfo)); + return interval; }; @@ -146,6 +147,7 @@ export class Column extends BaseChart { }, }); // this.instance.interaction('element-active'); + this.instance.legend(false); this.instance.render(); } catch (err) {} }; diff --git a/src/donut/framework.ts b/src/donut/framework.ts index 0ab3c320..d6652b63 100644 --- a/src/donut/framework.ts +++ b/src/donut/framework.ts @@ -99,6 +99,7 @@ export class Donut extends BaseChart { textView.render(); fetchTooltip(this.instance, config); + this.instance.legend(false); this.instance.render(); this.instance.render(true); diff --git a/src/double-axes/framework.ts b/src/double-axes/framework.ts index cddcf05f..0393d976 100644 --- a/src/double-axes/framework.ts +++ b/src/double-axes/framework.ts @@ -105,6 +105,7 @@ export class DoubleAxes extends BaseChart { this.lineShape(this.instance, options, lineCfg); fetchTooltip(this.instance, config); + this.instance.legend(false); this.instance.render(); this.instance.render(true);