Search code examples
javascripttradingview-apilightweight-charts

How to make TradingView chart show all points without having to scroll?


in this page https://ticr.live/ticker-demo.php i am showing the data generated roughly in the last 15mins, in a TradingView chart widget.

I wish that all points are visible inside the chart, without the need to scroll the chart left horizontally to see the past values, in case there are many points.

So the whole chart should "fit" exactly the container div.

How is this achieved? Thanks


Solution

  • Yes, you can fit all your data inside the chart by calling chart.timeScale().fitContent() method.