project-nv / night-vision

Highly customizable charting library, created for professional traders
https://nightvision.dev
MIT License
242 stars 57 forks source link

Range tool on index based charts #98

Open mariusvigariu opened 1 year ago

mariusvigariu commented 1 year ago

Describe the bug

I reckon this is low prio, but placing it here for future reference, the range tool on index based charts is not working. I assume it needs to be adjusted a little bit since x and y values of the pins are not properly computed for index based charts

Reproduction

https://github.com/project-nv/night-vision/blob/main/src/scripts/tools/RangeTool.navy#L15

Steps to reproduce

  1. spin up a chart with some dummy data
  2. add the tool range
  3. make the chart non index based
  4. see it's working
  5. make the chart index based
  6. see it's not working

Javascript Framework

no-framework (vanilla-js)

Logs

No response

Validations