Pre loader

Implementing a custom modifier for touch tracking along the chart

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

i want to implement a custom modifier to track the users touch, similar to rollover but without displaying a view

I tried to do this by implementing SCIGestureModifier and overriding all the onTouches methods, but – no matter the user behaviour – the modifier will always receive an onTouchesCancelled event after about a second and receive no more of these events after that.

What does work is implement onPanGesture to actually track all the user’s movement but i don’t see any way of how you would receive a touch up event this way (which i do need)

Is there any fundamental misunderstanding on how this should work on my side?

Version
2.5.0.2589
  • You must to post comments
1
0

Internally SCIChart surface uses a UIPanGestureRecognizer to track panning, which has default value YES for cancelsTouchesInView property, thats why you receive touchesCancelled callback as soon as pan was recognised.

So I can suggest you several workarounds for you, please chose the one which covers your needs the best:

1) Disable handling pan on your surface (only in case if you don’t need to use SCICursorModifier, SCITooltipModifier or SCIRolloverModifier).
This can be done using following code:

yourChartSurface.gestureController.disablePanGesture()

2) Or, use callback from GestureRecognizer to track finger movement instead of overriding onTouchesMoved – override

-(BOOL) onPanGesture:(UIPanGestureRecognizer*)gesture At:(UIView*)view;

and place your finger movement handling logic there. Thats how you can start handling finger position when touch occurs (before even gesture was recognised) and continue after recognising a movement, until the gesture is finished (check on gestureRecognizer.state to know when the finger released).

  • You must to post comments
0
0

I built a small sample project to demonstrate this behaviour

https://uploads.mobivention.eu/7c4b5d895940

As you can see from the console output, onTouchesCancelled is always called prematurely and onTouchesEnded will never get called

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies