Skip to content

Commit

Permalink
price&volume precision only works in crosshair label
Browse files Browse the repository at this point in the history
  • Loading branch information
Mazq committed Aug 15, 2024
1 parent d6ad0bd commit 7f79a07
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/feature/depth-chart/chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,8 @@ export class Chart extends EventEmitter {
(priceLevel) => priceLevel[1],
);

this.volumeLabels = this.volumes.map((volume) => String(volume));
this.volumeLabels = this.volumes.map((volume) => this.volumeFormat(volume));
// this.volumeLabels = this.volumes.map((volume) => String(volume));
// console.log(this.volumeLabels);
this.update();
this.render();
Expand Down
4 changes: 2 additions & 2 deletions src/feature/depth-chart/depth-chart.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -456,8 +456,8 @@ FractionalVolume.args = {
volume: priceLevel.volume / 100,
})),
},
// priceFormat: (price: number) => numberFormatter(5).format(price),
// volumeFormat: (volume: number) => numberFormatter(2).format(volume),
priceFormat: (price: number) => numberFormatter(5).format(price),
volumeFormat: (volume: number) => numberFormatter(3).format(volume),
};

export const UnsortedPriceLevels = Template.bind({});
Expand Down

0 comments on commit 7f79a07

Please sign in to comment.