Skip to content

Commit

Permalink
Merge pull request #157 from pepstock-org/fixDatalabels
Browse files Browse the repository at this point in the history
Use translation from label items options
  • Loading branch information
sgratzl committed Dec 27, 2022
2 parents 6dd0123 + 0d46cd4 commit 92e1291
Showing 1 changed file with 3 additions and 2 deletions.
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

0 comments on commit 92e1291

Please sign in to comment.