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

time2x returns wrong number when used indexBased #117

Open
4 tasks done
Mohammad-Reza-Karimi opened this issue Apr 12, 2024 · 0 comments
Open
4 tasks done

time2x returns wrong number when used indexBased #117

Mohammad-Reza-Karimi opened this issue Apr 12, 2024 · 0 comments

Comments

@Mohammad-Reza-Karimi
Copy link

Describe the bug

i set "indexBased": "true"
and i use custom.navy as custom drawing on chart
when i try this ==> "let x = layout.time2x(timestamp);" it returns very big number like this ==> 5608196711811
even if i set "indexBased": "false" still it returns wrong position ==> 5608197201458
when i remove "indexBased": "true" it returns correct x position ==>125776
but i need indexbased chart

Reproduction

https://codesandbox.io/s/playing-around-7-xyquxe?from-embed

Steps to reproduce

I've added "indexBased": "true" to data-1.json like below and it made the bug because of "let x = layout.time2x(p[0])" in custom.navy , line 30

{
"panes": [....],
"indexBased": "true"
}

Javascript Framework

no-framework (vanilla-js)

Logs

No response

Validations

  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Make sure this is a NightVision issue and not a framework-specific issue.
  • The provided reproduction is a minimal reproducible example of the bug.
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

No branches or pull requests

1 participant