Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Entering Tracking Mode on Mobile #1198

Closed
shonsirsha opened this issue Nov 7, 2022 · 7 comments · Fixed by #1432
Closed

Entering Tracking Mode on Mobile #1198

shonsirsha opened this issue Nov 7, 2022 · 7 comments · Fixed by #1432
Labels
enhancement Feature requests, and general improvements. polish Very minor behavior improvement that users will enjoy.
Milestone

Comments

@shonsirsha
Copy link

Hey there, how do I enter tracking mode on mobile without a long-press? Is this even possible? If it's not possible by default, does anyone havw an example of a "hack" they used to make this work?

Thanks and congrats on a great project.

@SlicedSilver SlicedSilver added enhancement Feature requests, and general improvements. polish Very minor behavior improvement that users will enjoy. labels Nov 14, 2022
@SlicedSilver
Copy link
Contributor

At the moment there isn't a way to enter tracking mode through the API.

Out of interest, what is your use-case for needing this? Your feedback could help us improve the API and enable this functionality in the future.

@tomsnep
Copy link

tomsnep commented Jan 17, 2023

@SlicedSilver
I'm currently experimenting with the library to replace a custom svg chart. I really love the lib so far so great job and many thanks! I came across this issue and i agree with @shonsirsha that it would be great if there's some flexibility in entering the tracking mode.

On mobile, a long press is not always the first thing people try to do when interacting with a Chart. In our current custom solution it works like this: if a user swipes horizontaly for more than x pixel, the tracking mode is activated. Therefore a user could still scroll vertically but activate the chart while swiping horizontally on the chart. It would be really nice if therefore it would be possible to manually activate trackingmode or provide more options to activate it besides long-press

@SlicedSilver
Copy link
Contributor

@tomsnep Thanks for the feedback and suggestion.

Sounds like a perfectly valid use case, and something that we will consider adding to a milestone in the future.

For your use-case, would an API method such as chart.setTrackingMode(...) be sufficient?

@tomsnep
Copy link

tomsnep commented Jan 17, 2023

@SlicedSilver Thanks for the quick response!

I think having a way to programmatically toggle it would be very nice

@MuslemRahimi
Copy link

Was the problem fixed or does a solution in the internet exist. I have the same issue. I want to enter the trackingMode instantly when the user touches the graph on mobile devices. Any help is much appreciated since the issue is very urgent for me :(

@trevorwhealy
Copy link

trevorwhealy commented Mar 10, 2023

We also have this problem. In our case, we have set both handleScroll and handleScale to false as we don't want the scrubbing or scaling feature. In fact, we only want tracking. Users on mobile are expecting to have the chart be immediately interactive on press but I don't see any way to override it.

@SlicedSilver SlicedSilver added this to the 4.1 milestone Mar 11, 2023
@edew edew mentioned this issue Oct 2, 2023
3 tasks
@SlicedSilver
Copy link
Contributor

Whilst not directly the API you requested, we have added a setCrosshairPosition API which meant your requirements.

You could disable both handleScroll and handleScale, and then handle the crosshair position yourself with a normal event listener.

Here is an example: https://github.com/tradingview/lightweight-charts/blob/acb80ab74592930012afa8aea393428fa8179460/website/tutorials/how_to/set-crosshair-position-tracking.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature requests, and general improvements. polish Very minor behavior improvement that users will enjoy.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants