lightweight-charts icon indicating copy to clipboard operation
lightweight-charts copied to clipboard

Set visible range with percent right margin

Open kirchet opened this issue 3 years ago • 4 comments

Type of PR: enhancement

PR checklist:

  • [x] Addresses an existing issue: fixes #840
  • [x] Includes tests
  • [x] Documentation update

Overview of change:

chart.timeScale().setVisibleRange({ from, to }, { percentRightMargin: 10 });

kirchet avatar Sep 01 '21 14:09 kirchet

@DTupalov do you really need this API? It seems that for logical ranges it might be done externally from your code so I just curious whether this API is needed for someone.

timocov avatar Sep 08 '21 12:09 timocov

@DTupalov do you really need this API? It seems that for logical ranges it might be done externally from your code so I just curious whether this API is needed for someone.

@timocov I've realised such ability with logical range, but this need some calculations on my side, so if this would be just a part of library, would be more declarative in my code.

Why then you implement this API? :)

DTupalov avatar Sep 08 '21 14:09 DTupalov

Why then you implement this API? :)

Ha-ha, fair enough 😄

I've realised such ability with logical range, but this need some calculations on my side, so if this would be just a part of library, would be more declarative in my code.

We realised exactly the same, that's why I'm a bit confused with having this in the library (just to avoid having anything what could be done outside in 2-3 lines).

timocov avatar Sep 09 '21 16:09 timocov

Agreed internally that it is no longer required.

SlicedSilver avatar Feb 09 '23 15:02 SlicedSilver