简体   繁体   中英

How do I update chart with new data in TradingView Lightweight charts

I am currently displaying an areaseries chart on a php page. The data gets populated during the initial page load which I fetch from database. Now I want to update the chart with duration, say for 1 week, 1 year etc. Couldn't find in the documentation as to how to delete the series or reload the chart with new data. I scoured the docs and github links but couldn't find what I was looking for.

Any pointers please.

if you use tradingview lightweight-charts library, you can use .update for example :

lineSeries.update(data)
candleSeries.update(data)
areaSeries.update(data)

The format of the data dictionary datas must be the same as the one you set them

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM