David Ramsaran
David Ramsaran

Reputation: 17

Victory Native y axis values. Can you get a list of values before rendering?

When rendering a user's account balance, I may have y axis values of [100, 125, 150, 200] that is autogenerated by the chart which is fine. Sometimes the chart autogenerates with decimal places [100, 125.5, 150.5, 200] which is a problem.

I want to normalize this so that if there are decimal places in one of the y axis values. Every label should be toFixed(2) (two decimals).

So the above example would be [100.00, 125.50, 150.50, 200.00]

How can I do that? If that can't be done within the API, is there a function somewhere in the codebase that calculates the y axis values that I can run before rendering the chart and having a flag for formatYLabel to render with decimal places or not.

Any help would be appreciated! Thanks

Upvotes: 0

Views: 36

Answers (0)

Related Questions