tradingview / lightweight-charts-android

Android wrapper for lightweight-charts library
Apache License 2.0
101 stars 34 forks source link

Setting setVisibleXRangeMaximum or moveViewToX Like MPAndroidChart #103

Closed iman051996 closed 2 years ago

iman051996 commented 2 years ago

im sorry before, i have develop line chart using MPAndroidChart, but that libs doesn't have more animated feature like TradingView, so, i was confused how to set visible of data that view on linechart, then move to the focus data by range

Example: i have 300 row data insert to LineChart, then i want to limit the data not from index 0, but from 100 to 300, then the chart is set from 280 - 300 from data that to show on first load

timocov commented 2 years ago

Albeit this looks like a feature request for lightweight-charts itself, can you provide some examples and use cases where you'd like to restrict visible range not by existent data but by some range within this data?

iman051996 commented 2 years ago

like on this case sir https://stackoverflow.com/questions/55620092/mpandroidchart-set-current-visible-x-axis

timocov commented 2 years ago

Ah I see, you don't want to restrict scrolling, you would like to restore visible range, right? If so, then you can use the following methods (the link is for js version, but I believe the API should be the same):