简体   繁体   English

如何使用 TradingView 轻量级图表中的新数据更新图表

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

I am currently displaying an areaseries chart on a php page.我目前正在 php 页面上显示一个areaseries 图表。 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.现在我想用持续时间更新图表,比如 1 周、1 年等。在文档中找不到关于如何删除系列或用新数据重新加载图表的信息。 I scoured the docs and github links but couldn't find what I was looking for.我搜索了文档和 github 链接,但找不到我要找的东西。

Any pointers please.请任何指点。

if you use tradingview lightweight-charts library, you can use .update for example :如果您使用 tradeview 轻量级图表库,则可以使用 .update 例如:

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数据字典数据的格式必须与您设置的格式相同

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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