Xamarin.Forms

Upgrade Guide User Guide Demos Support Forums Download
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class ChartTrackballBehavior - Xamarin.Forms API Reference | Syncfusion

    Show / Hide Table of Contents

    Class ChartTrackballBehavior

    This class is used to enable trackball in SfChart. An instance of this class need to be added to ChartBehaviors collection.

    Inheritance
    System.Object
    ChartBehavior
    ChartTrackballBehavior
    Inherited Members
    ChartBehavior.OnTouchDown(Single, Single)
    ChartBehavior.OnTouchMove(Single, Single)
    ChartBehavior.OnTouchUp(Single, Single)
    ChartBehavior.DoubleTap(Single, Single)
    ChartBehavior.Chart
    Namespace: Syncfusion.SfChart.XForms
    Assembly: Syncfusion.SfChart.XForms.dll
    Syntax
    public class ChartTrackballBehavior : ChartBehavior, IThemeElement
    Remarks

    ChartTrackBallBehavior displays a vertical line,a tracker ball symbol and a popup like control displaying information about the data point, at mouse move positions/ at touch contact positions over a Series. Multiple trackball having effect only when the ActivationMode is set as None.

    Examples
    SfChart chart = new SfChart();
    ChartTrackballBehavior trackball = new ChartTrackballBehavior();
    chart.ChartBehaviors.Add(trackball);

    Constructors

    ChartTrackballBehavior()

    Initializes a new instance of the ChartTrackballBehavior class.

    Declaration
    public ChartTrackballBehavior()

    Fields

    ActivationModeProperty

    Gets or sets the value that indicates whether to activate trackball based on the specified touch mode. This is a bindable property.

    Declaration
    public static readonly BindableProperty ActivationModeProperty
    Field Value
    Type Description
    Xamarin.Forms.BindableProperty
    Remarks

    The default value of ActivationMode property in Android and iOS is LongPress and the default value for the same in MacOS and UWP is TouchMove.

    LabelDisplayModeProperty

    Gets or sets the value that indicates whether to display labels for all the data points or only to the nearest data point in trackball. This is a bindable property.

    Declaration
    public static readonly BindableProperty LabelDisplayModeProperty
    Field Value
    Type Description
    Xamarin.Forms.BindableProperty

    LabelStyleProperty

    Gets or sets the customized style for the trackball label. This is a bindable property.

    Declaration
    public static readonly BindableProperty LabelStyleProperty
    Field Value
    Type Description
    Xamarin.Forms.BindableProperty

    LineStyleProperty

    Gets or sets the customized style for the trackball line. This is a bindable property.

    Declaration
    public static readonly BindableProperty LineStyleProperty
    Field Value
    Type Description
    Xamarin.Forms.BindableProperty

    MarkerStyleProperty

    Gets or sets the customized style for the trackball marker. This is a bindable property.

    Declaration
    public static readonly BindableProperty MarkerStyleProperty
    Field Value
    Type Description
    Xamarin.Forms.BindableProperty

    ShowLabelProperty

    Gets or sets the value that indicates whether to show the point information, when the trackball is shown. This is a bindable property.

    Declaration
    public static readonly BindableProperty ShowLabelProperty
    Field Value
    Type Description
    Xamarin.Forms.BindableProperty

    ShowLineProperty

    Gets or sets the value that indicates whether to show the trackball line, when the trackball is shown. This is a bindable property.

    Declaration
    public static readonly BindableProperty ShowLineProperty
    Field Value
    Type Description
    Xamarin.Forms.BindableProperty

    Properties

    ActivationMode

    Gets or sets the value that indicates whether to activate trackball based on the specified touch mode. This is a bindable property.

    Declaration
    public ChartTrackballActivationMode ActivationMode { get; set; }
    Property Value
    Type Description
    ChartTrackballActivationMode

    The activate mode.

    LabelDisplayMode

    Gets or sets the value that indicates whether to display labels for all the data points or only to the nearest data point in trackball. This is a bindable property.

    Declaration
    public TrackballLabelDisplayMode LabelDisplayMode { get; set; }
    Property Value
    Type Description
    TrackballLabelDisplayMode

    This property take TrackballLabelDisplayModeean value.

    LabelStyle

    Gets or sets the customized style for the track ball label. This is a bindable property.

    Declaration
    public ChartTrackballLabelStyle LabelStyle { get; set; }
    Property Value
    Type Description
    ChartTrackballLabelStyle

    This property takes the LabelStyle as its value.

    LineStyle

    Gets or sets the customized style for the trackball line. This is a bindable property.

    Declaration
    public ChartLineStyle LineStyle { get; set; }
    Property Value
    Type Description
    ChartLineStyle

    This property takes the ChartLineStyle as its value.

    MarkerStyle

    Gets or sets the customized style for the trackball marker. This is a bindable property.

    Declaration
    public ChartTrackballMarkerStyle MarkerStyle { get; set; }
    Property Value
    Type Description
    ChartTrackballMarkerStyle

    This property takes the MarkerStyle as its value.

    ShowLabel

    Gets or sets a value indicating whether to show the point information, when the trackball is shown. This is a bindable property.

    Declaration
    public bool ShowLabel { get; set; }
    Property Value
    Type Description
    System.Boolean

    This property take Boolean value.

    ShowLine

    Gets or sets a value indicating whether to show the trackball line, when the trackball is shown. This is a bindable property.

    Declaration
    public bool ShowLine { get; set; }
    Property Value
    Type Description
    System.Boolean

    This property take Boolean value.

    Methods

    Hide()

    Hides the trackball that is visible in the chart.

    Declaration
    public void Hide()

    HitTest(Single, Single)

    Method to check whether the point is in trackball or not.

    Declaration
    public virtual bool HitTest(float pointX, float pointY)
    Parameters
    Type Name Description
    System.Single pointX

    point x.

    System.Single pointY

    point y.

    Returns
    Type Description
    System.Boolean

    bool value.

    OnBindingContextChanged()

    Override this method to execute an action when the BindingContext changes.

    Declaration
    protected override void OnBindingContextChanged()

    OnLongPress(Single, Single)

    Declaration
    protected virtual void OnLongPress(float pointX, float pointY)
    Parameters
    Type Name Description
    System.Single pointX
    System.Single pointY

    OnParentSet()

    Declaration
    protected override void OnParentSet()

    Show(Single, Single)

    Shows the trackball in the given x and y position.

    Declaration
    public void Show(float pointX, float pointY)
    Parameters
    Type Name Description
    System.Single pointX

    point x.

    System.Single pointY

    point y.

    Back to top Generated by DocFX
    Copyright © 2001 - 2022 Syncfusion Inc. All Rights Reserved