Pre loader

Is there a set order in which the chart modifiers receive the touch event?



I have multiple custom chart modifiers (PinchZoom, Rollover, SeriesSelection and ZoomPan) and I was wondering if there is a set order in which they handle the touch event or is it random? If there is a set order then can I change this order?

For example now it seems like the rollover modifier handles the touch event before the seriesSelection modifier. This is a bit problematic since the rollover has sourceMode = SourceMode.SelectedSeries and since the touch event goes first to the rollover it updates its position –> then the new series is selected –> but rollover position does not update since it has already handled the touch event.

  • You must to post comments
Best Answer

Hi Erika,

By default order of receiveing touch events is determined by their order in ChartModifiers collection. If you use ModifierGroup then when onTouch() method is called on this modifier it notifies its ChildModifiers by iterating over them in for loop and calling onTouch() on each child modifier. So to sum it up – if you have next modifiers in ChartModifiers:

  • Modifier1
  • ModifierGroup which ChildModifiers = [Modifier2, Modifier3, Modifier4]
  • Modifier5

then onTouch() will be called for Modifier1, then for ModifierGroup ( ModifierGroup will call onTouch() for Modifier2, 3 and 4 ) and in the end for Modifier5.

Also for some modifiers ( such as gesture modifiers ) there could be delay caused by gesture detector. For example ZoomPanModifier doesn’t start scrolling immediately after receivent first touch event, because it performs analysis of touch event sequence to determine whether or no they form a scroll gesture.

BTW we have ReceiveHandledEvents property which allows modifier to process touch events even if they are already handled by other modifiers. By default it is set to false, but you can set it to true for RolloverModifier if you want it to receive events that are handled by SeriesSelectionModifier.

Best regards,

  • You must to post comments
Showing 1 result
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