Get the touch position in chart

9 Jan 20252 minutes to read

ChartBehavior provides the following override methods to get the x and y positions when touch the Chart.

  • OnTouchUp - Called when touch up on the chart area with respective x and y position.
  • OnTouchMove - Called when touch move on the chart area with respective x and y position.
  • OnTouchDown - Called when touch down on the chart area with respective x and y position.
  • DoubleTap - Called when double tap on the chart area with respective x and y position.
  • C#
  • public class ChartTooltipBehaviorExt : ChartTooltipBehavior
    {
            
            protected override void OnTouchUp(float pointX, float pointY)
            {
                   base.OnTouchUp(pointX, pointY);
            }
    
            protected override void OnTouchMove(float pointX, float pointY)
            {
                   base.OnTouchMove(pointX, pointY);
            }
    
            protected override void OnTouchDown(float pointX, float pointY)
            {
                   base.OnTouchDown(pointX, pointY);
            }
    
            protected override void DoubleTap(float pointX, float pointY)
            {
                   base.DoubleTap(pointX, pointY);
            }
          
    }