tradingview 选中点击某条k线,获取他的数据,并渲染到导航栏
2021-11-30 10:44:29
more 
1509

代码

                //选中k线点击k线 
                //time当前列的时间price当前列鼠标高度的价格
                //需要判断时间是否存在数据中再获取相关的数据开盘价收盘价等等
                this.chart.activeChart().crossHairMoved().subscribe(null,({ time, price }) => {
                    console.log('选中k线',time, price)
                });

点击某条K线回调函数会有两个参数time为点击的那一列的时间利用time和自己的数据进行遍历取值。

this.chart.subscribe("mouse_up",()=>{
                })

点击释放后还原数据。

Statement:
The content of this article does not represent the views of fxgecko website. The content is for reference only and does not constitute investment suggestions. Investment is risky, so you should be careful in your choice! If it involves content, copyright and other issues, please contact us and we will make adjustments at the first time!

Related News

您正在访问的是FxGecko网站。 FxGecko互联网及其移动端产品是中国香港特别行政区成立的Hitorank Co.,LIMITED旗下运营和管理的一款面向全球发行的企业资讯査询工具。

您的IP为 中国大陆地区,抱歉的通知您,不能为您提供查询服务,还请谅解。请遵守当地地法律。