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

Use translation from label items options #157

Merged
merged 2 commits into from Dec 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/scales/SizeScale.ts
Expand Up @@ -73,8 +73,9 @@ export class SizeScale extends LegendScale<ISizeScaleOptions & LinearScaleOption

const isHor = this.isHorizontal();
const values = this.ticks;
const positions = (this as any)._labelItems
? (this as any)._labelItems.map((el: any) => ({ [isHor ? 'x' : 'y']: el.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) => {
Expand Down