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

OHLC legend precision matches the precision of the rest of the chart #500

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

robustify
Copy link

In the commit for the 1.0.16 release (34ce3f7), the precision method of the Chart object was modifed such that the OHLC legend overlay showed prices with the same number of decimal places the user specified in precision.

This functionality regressed with the release of 2.0. Comparing the 1.0.x and 2.x precision methods, I noticed that this line was removed, which is part of the script passed to run_script:

{self.id}.precision = {precision}

This PR simply adds this line back to the script in the precision method. I used the styling example to test. Running it without calling precision uses the default 2 decimal places:

Screenshot from 2024-12-19 18-53-25

Adding

chart.precision(4)

Screenshot from 2024-12-19 18-53-49

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant