menu

UWP

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class ChartCrossHairBehavior - UWP API Reference | Syncfusion

    Show / Hide Table of Contents

    Class ChartCrossHairBehavior

    ChartCrossHairBehavior enables viewing of informations related to Chart coordinates, at mouse over position or at touch contact point inside a Chart.

    Inheritance
    System.Object
    ChartBehavior
    ChartCrossHairBehavior
    Implements
    ICloneable
    Inherited Members
    ChartBehavior.AdorningCanvas
    ChartBehavior.BottomAdorningCanvas
    ChartBehavior.ChartArea
    ChartBehavior.chartAxis
    ChartBehavior.Clone()
    ChartBehavior.DetachElement(UIElement)
    ChartBehavior.GetYValuesBasedOnIndex(Double, ChartSeriesBase)
    ChartBehavior.OnDoubleTapped(DoubleTappedRoutedEventArgs)
    ChartBehavior.OnDragEnter(DragEventArgs)
    ChartBehavior.OnDragLeave(DragEventArgs)
    ChartBehavior.OnDragOver(DragEventArgs)
    ChartBehavior.OnDrop(DragEventArgs)
    ChartBehavior.OnGotFocus(RoutedEventArgs)
    ChartBehavior.OnKeyDown(KeyRoutedEventArgs)
    ChartBehavior.OnKeyUp(KeyRoutedEventArgs)
    ChartBehavior.OnLostFocus(RoutedEventArgs)
    ChartBehavior.OnManipulationCompleted(ManipulationCompletedRoutedEventArgs)
    ChartBehavior.OnManipulationDelta(ManipulationDeltaRoutedEventArgs)
    ChartBehavior.OnManipulationInertiaStarting(ManipulationInertiaStartingRoutedEventArgs)
    ChartBehavior.OnManipulationStarted(ManipulationStartedRoutedEventArgs)
    ChartBehavior.OnManipulationStarting(ManipulationStartingRoutedEventArgs)
    ChartBehavior.OnPointerCanceled(PointerRoutedEventArgs)
    ChartBehavior.OnPointerCaptureLost(PointerRoutedEventArgs)
    ChartBehavior.OnPointerEntered(PointerRoutedEventArgs)
    ChartBehavior.OnPointerWheelChanged(PointerRoutedEventArgs)
    ChartBehavior.OnRightTapped(RightTappedRoutedEventArgs)
    ChartBehavior.OnTapped(TappedRoutedEventArgs)
    ChartBehavior.UpdateArea()
    Namespace: Syncfusion.UI.Xaml.Charts
    Assembly: Syncfusion.SfChart.UWP.dll
    Syntax
    public class ChartCrossHairBehavior : ChartBehavior, ICloneable
    Remarks

    ChartCrossHairBehavior displays a vertical line, horizontal line and a popup like control displaying information about the data point at touch contact point or at mouse over position. You can also customize the look of cross hair and information displayed in a label.

    Examples

    This example, we are using ChartCrossHairBehavior.

        <syncfusion:SfChart>
            <syncfusion:SfChart.Behaviors>
                <syncfusion:ChartCrossHairBehavior/>
            </syncfusion:SfChart.Behaviors>
        </syncfusion:SfChart>
        ChartCrossHairBehavior crossHair = new ChartCrossHairBehavior();
        chartArea.Behaviors.Add(crossHair);

    Constructors

    ChartCrossHairBehavior()

    Called when instance created for ChartCrossHairBehavior.

    Declaration
    public ChartCrossHairBehavior()

    Fields

    CurrentPoint

    Used to specify the current location.

    Declaration
    protected Point CurrentPoint
    Field Value
    Type
    Windows.Foundation.Point

    HorizontalAxisLabelAlignmentProperty

    The DependencyProperty for HorizontalAxisLabelAlignment property.

    Declaration
    public static readonly DependencyProperty HorizontalAxisLabelAlignmentProperty
    Field Value
    Type
    Windows.UI.Xaml.DependencyProperty

    HorizontalLineStyleProperty

    The DependencyProperty for HorizontalLineStyle property.

    Declaration
    public static readonly DependencyProperty HorizontalLineStyleProperty
    Field Value
    Type
    Windows.UI.Xaml.DependencyProperty

    VerticalAxisLabelAlignmentProperty

    The DependencyProperty for VerticalAxisLabelAlignment property.

    Declaration
    public static readonly DependencyProperty VerticalAxisLabelAlignmentProperty
    Field Value
    Type
    Windows.UI.Xaml.DependencyProperty

    VerticalLineStyleProperty

    The DependencyProperty for VerticalLineStyle property.

    Declaration
    public static readonly DependencyProperty VerticalLineStyleProperty
    Field Value
    Type
    Windows.UI.Xaml.DependencyProperty

    Properties

    HorizontalAxisLabelAlignment

    Gets or sets the alignment for the label appearing in horizontal axis.

    Declaration
    public ChartAlignment HorizontalAxisLabelAlignment { get; set; }
    Property Value
    Type Description
    ChartAlignment

    ChartAlignment

    HorizontalLineStyle

    Gets or sets the style for horizontal line.

    Declaration
    public Style HorizontalLineStyle { get; set; }
    Property Value
    Type
    Windows.UI.Xaml.Style

    IsActivated

    Gets or sets a value indicating whether the crosshair is activated or not.

    Declaration
    protected bool IsActivated { get; set; }
    Property Value
    Type
    System.Boolean

    PointInfos

    Gets the collection of ChartPointInfo.

    Declaration
    public ObservableCollection<ChartPointInfo> PointInfos { get; }
    Property Value
    Type
    System.Collections.ObjectModel.ObservableCollection<ChartPointInfo>

    VerticalAxisLabelAlignment

    Gets or sets the alignment for the label appearing in vertical axis.

    Declaration
    public ChartAlignment VerticalAxisLabelAlignment { get; set; }
    Property Value
    Type Description
    ChartAlignment

    ChartAlignment

    VerticalLineStyle

    Gets or sets the style for vertical line.

    Declaration
    public Style VerticalLineStyle { get; set; }
    Property Value
    Type
    Windows.UI.Xaml.Style

    Methods

    AddElement(UIElement)

    Method implementation for add elements in UIElement.

    Declaration
    protected void AddElement(UIElement element)
    Parameters
    Type Name Description
    Windows.UI.Xaml.UIElement element

    UIElement

    AddLabel(ChartPointInfo, ChartAlignment, ChartAlignment, DataTemplate)

    Method implementation for adding label in crosshair.

    Declaration
    protected void AddLabel(ChartPointInfo obj, ChartAlignment verticalAlignment, ChartAlignment horizontalAlignment, DataTemplate template)
    Parameters
    Type Name Description
    ChartPointInfo obj

    ChartPointInfo

    ChartAlignment verticalAlignment

    Used to specify ChartAlignment for vertical

    ChartAlignment horizontalAlignment

    Used to specify ChartAlignment for horizontal

    Windows.UI.Xaml.DataTemplate template

    DataTemplate

    AddLabel(Object, ChartAlignment, ChartAlignment, DataTemplate, Double, Double)

    Method implementation for adding labels in Crosshair.

    Declaration
    protected virtual void AddLabel(object obj, ChartAlignment verticalAlignemnt, ChartAlignment horizontalAlignment, DataTemplate labelTemplate, double x, double y)
    Parameters
    Type Name Description
    System.Object obj

    ChartPointInfo

    ChartAlignment verticalAlignemnt

    Used to specify ChartAlignment for vertical

    ChartAlignment horizontalAlignment

    Used to specify ChartAlignment for horizontal

    Windows.UI.Xaml.DataTemplate labelTemplate

    DataTemplate

    System.Double x

    The X location

    System.Double y

    The Y location

    AlignDefaultLabel(ChartAlignment, ChartAlignment, Double, Double, ContentControl)

    Align the element inside the content control.

    Declaration
    protected override void AlignDefaultLabel(ChartAlignment verticalAlignemnt, ChartAlignment horizontalAlignment, double x, double y, ContentControl control)
    Parameters
    Type Name Description
    ChartAlignment verticalAlignemnt

    Used to specify ChartAlignment for vertical

    ChartAlignment horizontalAlignment

    Used to specify ChartAlignment for horizontal

    System.Double x

    The X location

    System.Double y

    The Y location

    Windows.UI.Xaml.Controls.ContentControl control

    Used to specify corresponding content control

    Overrides
    ChartBehavior.AlignDefaultLabel(ChartAlignment, ChartAlignment, Double, Double, ContentControl)

    AttachElements()

    Method implementation for AttachElements.

    Declaration
    protected override void AttachElements()
    Overrides
    ChartBehavior.AttachElements()

    CloneBehavior(DependencyObject)

    Declaration
    protected override DependencyObject CloneBehavior(DependencyObject obj)
    Parameters
    Type Name Description
    Windows.UI.Xaml.DependencyObject obj
    Returns
    Type
    Windows.UI.Xaml.DependencyObject
    Overrides
    ChartBehavior.CloneBehavior(DependencyObject)

    DetachElements()

    Method implementation for DetachElements.

    Declaration
    protected override void DetachElements()
    Overrides
    ChartBehavior.DetachElements()

    GenerateLabel(ChartPointInfo, ChartAxis)

    Method implementation to generate trackball label for axis.

    Declaration
    protected virtual void GenerateLabel(ChartPointInfo pointInfo, ChartAxis axis)
    Parameters
    Type Name Description
    ChartPointInfo pointInfo

    ChartPointInfo

    ChartAxis axis

    ChartAxis

    OnHolding(HoldingRoutedEventArgs)

    Called when holding the focus in UIElement.

    Declaration
    protected override void OnHolding(HoldingRoutedEventArgs e)
    Parameters
    Type Name Description
    Windows.UI.Xaml.Input.HoldingRoutedEventArgs e

    HoldingRoutedEventArgs

    Overrides
    ChartBehavior.OnHolding(HoldingRoutedEventArgs)

    OnLayoutUpdated()

    Called when the layout updated from chart.

    Declaration
    protected override void OnLayoutUpdated()
    Overrides
    ChartBehavior.OnLayoutUpdated()

    OnPointerExited(PointerRoutedEventArgs)

    Called when pointer exited from the chart.

    Declaration
    protected override void OnPointerExited(PointerRoutedEventArgs e)
    Parameters
    Type Name Description
    Windows.UI.Xaml.Input.PointerRoutedEventArgs e

    PointerRoutedEventArgs

    Overrides
    ChartBehavior.OnPointerExited(PointerRoutedEventArgs)

    OnPointerMoved(PointerRoutedEventArgs)

    Called when pointer moved in the chart.

    Declaration
    protected override void OnPointerMoved(PointerRoutedEventArgs e)
    Parameters
    Type Name Description
    Windows.UI.Xaml.Input.PointerRoutedEventArgs e

    PointerRoutedEventArgs

    Overrides
    ChartBehavior.OnPointerMoved(PointerRoutedEventArgs)

    OnPointerPressed(PointerRoutedEventArgs)

    Called when pointer pressed in the chart.

    Declaration
    protected override void OnPointerPressed(PointerRoutedEventArgs e)
    Parameters
    Type Name Description
    Windows.UI.Xaml.Input.PointerRoutedEventArgs e

    PointerRoutedEventArgs

    Overrides
    ChartBehavior.OnPointerPressed(PointerRoutedEventArgs)

    OnPointerReleased(PointerRoutedEventArgs)

    Called when pointer released in the chart.

    Declaration
    protected override void OnPointerReleased(PointerRoutedEventArgs e)
    Parameters
    Type Name Description
    Windows.UI.Xaml.Input.PointerRoutedEventArgs e

    PointerRoutedEventArgs

    Overrides
    ChartBehavior.OnPointerReleased(PointerRoutedEventArgs)

    OnSizeChanged(SizeChangedEventArgs)

    Called when size changed.

    Declaration
    protected override void OnSizeChanged(SizeChangedEventArgs e)
    Parameters
    Type Name Description
    Windows.UI.Xaml.SizeChangedEventArgs e

    SizeChangedEventArgs

    Overrides
    ChartBehavior.OnSizeChanged(SizeChangedEventArgs)

    SetPosition(Point)

    Method implementation for set positions for given point.

    Declaration
    protected virtual void SetPosition(Point point)
    Parameters
    Type Name Description
    Windows.Foundation.Point point

    Point

    Implements

    ICloneable

    Extension Methods

    DateTimeExtension.ToDateTime(Object)
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved