tradingview 选中点击某条k线,获取他的数据,并渲染到导航栏
代码
//选中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!