lightweight-charts icon indicating copy to clipboard operation
lightweight-charts copied to clipboard

Add API to enter/exit in tracking mode

Open SimonVillage opened this issue 4 years ago • 6 comments

We are using the library mostly for mobile. When focusing the chart on mobile, you will get the crosshair with price / time information. If you remove your finger, the crosshair does not reset / blur. Is there any way to call that event?

I am actually looking for the event which is called when clicking the chart one more time which makes then looses the focus on the chart and makes the crosshair disappear.

SimonVillage avatar Mar 10 '20 09:03 SimonVillage

If you remove your finger, the crosshair does not reset / blur. Is there any way to call that event?

This is by design. It's called "tracking mode" and afaik it works on mobile only. To disable it an user needs to tap on the chart one more time. It allows you select a bar on touch devices properly and have it "selected" until an user wish it.

I am actually looking for the event which is called when clicking the chart one more time which makes then looses the focus on the chart and makes the crosshair disappear.

So you want to have a way to force exit from tracking mode, right?

timocov avatar Mar 10 '20 09:03 timocov

So you want to have a way to force exit from tracking mode, right?

correct

SimonVillage avatar Mar 10 '20 09:03 SimonVillage

I marked it as feature request, but meantime can you please tell more about your case? Why do you want it? Maybe tracking mode doesn't work for you well? Previously we made it for www.tradingview.com/chart and I didn't hear any request to have "fast exit" from tracking mode. I assume that we might miss something...

timocov avatar Mar 10 '20 10:03 timocov

we are using webview for the chart. We would like to get something similar as shown in the gif. Robinhood as example is using the same feature. The user can check the historical price and tracking will reset as soon as he lifts his finger avoiding an extra click to reset. In the meantime, is there any workaround which could work to stop tracking?

ezgif-3-657251001f51

SimonVillage avatar Mar 10 '20 10:03 SimonVillage

I just asked the team why we've changed that behavior on www.tradingview.com: the reason is that users didn't like that when you move your finger and if tooltip is shown nearly the finger, so you can't really see what is on that tooptip. And I do understand them - I just that one of the app I'm using for trading and it has exactly the same problem, you need to move your finger a bit higher or lower to see what is there...

But anyway I agree that we can add API to force exit from tracking mode (or even option to override that behavior).

timocov avatar Mar 10 '20 16:03 timocov

Related: https://tradingview.github.io/lightweight-charts/docs/api/interfaces/ChartOptions#trackingmode

SlicedSilver avatar Aug 26 '22 15:08 SlicedSilver