From 720e712c675ee8c7db5093343c4109fd5eb7c61c Mon Sep 17 00:00:00 2001 From: stockiNail Date: Tue, 27 Dec 2022 12:19:43 +0100 Subject: [PATCH 1/2] Use translation from label items options --- src/scales/SizeScale.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/scales/SizeScale.ts b/src/scales/SizeScale.ts index 3a0ee57..6c53178 100644 --- a/src/scales/SizeScale.ts +++ b/src/scales/SizeScale.ts @@ -74,7 +74,7 @@ export class SizeScale extends LegendScale ({ [isHor ? 'x' : 'y']: el.translation[isHor ? 0 : 1] })) + ? (this as any)._labelItems.map((el: any) => ({ [isHor ? 'x' : 'y']: el.options.translation[isHor ? 0 : 1] })) : values.map((_, i) => ({ [isHor ? 'x' : 'y']: this.getPixelForTick(i) })); ((this as any)._gridLineItems || []).forEach((item: any) => { From 0d46cd40d4d8f4e8a72a3c1716b32ecb39a4eceb Mon Sep 17 00:00:00 2001 From: stockiNail Date: Tue, 27 Dec 2022 20:39:52 +0100 Subject: [PATCH 2/2] apply review --- src/scales/SizeScale.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/scales/SizeScale.ts b/src/scales/SizeScale.ts index 6c53178..ba7ef7b 100644 --- a/src/scales/SizeScale.ts +++ b/src/scales/SizeScale.ts @@ -73,8 +73,9 @@ export class SizeScale extends LegendScale ({ [isHor ? 'x' : 'y']: el.options.translation[isHor ? 0 : 1] })) + const labelItems = this.getLabelItems(); + const positions = labelItems + ? labelItems.map((el: any) => ({ [isHor ? 'x' : 'y']: el.options.translation[isHor ? 0 : 1] })) : values.map((_, i) => ({ [isHor ? 'x' : 'y']: this.getPixelForTick(i) })); ((this as any)._gridLineItems || []).forEach((item: any) => {