From 53eb456120b4cae7463f7739beb32111f682dd21 Mon Sep 17 00:00:00 2001 From: wangyuhu Date: Tue, 10 Sep 2024 14:12:00 +0800 Subject: [PATCH] feat: legend position custom offset --- src/ui/legend/category.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ui/legend/category.ts b/src/ui/legend/category.ts index ad61c5a0..b5b96a08 100644 --- a/src/ui/legend/category.ts +++ b/src/ui/legend/category.ts @@ -71,8 +71,8 @@ export class Category extends Component { } private get availableSpace(): DOMRect { - const { showTitle, width, height } = this.attributes; - if (!showTitle) return new BBox(0, 0, width!, height!); + const { showTitle, width, height, dx = 0, dy = 0 } = this.attributes; + if (!showTitle) return new BBox(dx, dy, width!, height!); return (this.title.node() as Title).getAvailableSpace(); }