alexa
menu

Blazor Toolkit

    Show / Hide Table of Contents

    Class ChartCrosshairSettings

    Provides options to customize the crosshair for charts.

    Inheritance
    System.Object
    SfBaseComponent
    ChartSubComponent
    ChartCrosshairSettings
    Implements
    System.IAsyncDisposable
    Inherited Members
    SfBaseComponent.DisposeAsync()
    Namespace: Syncfusion.Blazor.Toolkit.Charts
    Assembly: Syncfusion.Blazor.Toolkit.dll
    Syntax
    public class ChartCrosshairSettings : ChartSubComponent, IAsyncDisposable, ISubcomponentTracker
    Remarks

    Configure general crosshair behavior and appearance. For axis-specific tooltip customization, use ChartAxisCrosshairTooltip within the respective axis.

    Constructors

    ChartCrosshairSettings()

    Declaration
    public ChartCrosshairSettings()

    Properties

    DashArray

    Gets or sets the dash pattern for the crosshair line.

    Declaration
    public string DashArray { get; set; }
    Property Value
    Type Description
    System.String

    A string defining the dash array (e.g., "5,3"). The default value is an empty string.

    Remarks

    Customize the visual style of the crosshair line using SVG dash patterns.

    Examples
    <ChartCrosshairSettings Enable="true" DashArray="5,3" />

    Enable

    Gets or sets a value indicating whether the crosshair is enabled.

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

    true to enable the crosshair; otherwise, false. The default value is false.

    Remarks

    When enabled, crosshair lines appear for precise inspection of data values.

    HighlightCategory

    Gets or sets a value indicating whether the entire category range is highlighted on hover.

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

    true to highlight the full category span; otherwise, false. Default is false.

    Remarks

    Applicable only to category axes.

    Examples
    <ChartCrosshairSettings Enable="true" HighlightCategory="true" />

    Line

    Gets or sets the crosshair line customization.

    Declaration
    public ChartCrosshairLine Line { get; set; }
    Property Value
    Type Description
    ChartCrosshairLine

    An instance of ChartCrosshairLine that configures color and width.

    Remarks

    Use this to override the default line styling.

    Examples
    <ChartCrosshairSettings Enable="true">
        <ChartCrosshairLine Width="2" Color="blue"></ChartCrosshairLine>
    </ChartCrosshairSettings>

    LineType

    Gets or sets the type of crosshair line to display.

    Declaration
    public LineType LineType { get; set; }
    Property Value
    Type Description
    LineType

    A LineType value:

    • None: Hides both vertical and horizontal lines.
    • Both: Shows both vertical and horizontal lines.
    • Vertical: Shows only the vertical line.
    • Horizontal: Shows only the horizontal line.
    Default is LineType.Both.
    Remarks

    Determines which crosshair lines are rendered.

    Examples
    <ChartCrosshairSettings Enable="true" LineType="LineType.Vertical" />

    SnapToData

    Gets or sets a value indicating whether the horizontal crosshair snaps to the nearest data point.

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

    true to snap to the nearest data point; otherwise, false. Default is false.

    Remarks

    Improves precision when hovering near data points on horizontal charts.

    Implements

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