alexa
menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Search Results for

    Show / Hide Table of Contents

    Class ChartCrosshairLine

    Provides option to customize the crosshair line of the chart.

    Inheritance
    object
    ComponentBase
    OwningComponentBase
    SfOwningComponentBase
    ChartSubComponent
    ChartDefaultBorder
    ChartCrosshairLine
    Implements
    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    Inherited Members
    ComponentBase.Assets
    ComponentBase.AssignedRenderMode
    ComponentBase.BuildRenderTree(RenderTreeBuilder)
    ComponentBase.DispatchExceptionAsync(Exception)
    ComponentBase.InvokeAsync(Action)
    ComponentBase.InvokeAsync(Func<Task>)
    ComponentBase.OnAfterRender(bool)
    ComponentBase.OnAfterRenderAsync(bool)
    ComponentBase.OnInitialized()
    ComponentBase.OnInitializedAsync()
    ComponentBase.OnParametersSet()
    ComponentBase.RendererInfo
    ComponentBase.SetParametersAsync(ParameterView)
    ComponentBase.ShouldRender()
    ComponentBase.StateHasChanged()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    OwningComponentBase.Dispose(bool)
    OwningComponentBase.IsDisposed
    OwningComponentBase.ScopedServices
    Namespace: Syncfusion.Blazor.Charts
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class ChartCrosshairLine : ChartDefaultBorder, IComponent, IHandleEvent, IHandleAfterRender, IDisposable

    Constructors

    ChartCrosshairLine()

    Declaration
    public ChartCrosshairLine()

    Properties

    Color

    Gets or sets the color of the crosshair line. Accepts values in hex or rgba as valid CSS color strings.

    Declaration
    [Parameter]
    public override string Color { get; set; }
    Property Value
    Type Description
    string

    A string specifying the color of the crosshair line. The default value is inherited from Color.

    Overrides
    ChartDefaultBorder.Color
    Remarks

    Use this property to customize the appearance of the crosshair line color on the chart.

    Examples
    // This example demonstrates how to enable crosshair in a Chart and customize its line color.
    <SfChart>
        <ChartCrosshairSettings Enable="true">
            <ChartCrosshairLine Width="2" Color="blue"></ChartCrosshairLine>
        </ChartCrosshairSettings>
        <ChartSeriesCollection>
            <ChartSeries DataSource="@Data" XName="XValue" YName="YValue">
            </ChartSeries>
        </ChartSeriesCollection>
    </SfChart>

    Width

    Gets or sets the width of the crosshair line in pixels.

    Declaration
    [Parameter]
    public override double Width { get; set; }
    Property Value
    Type Description
    double

    A double value representing the width of the crosshair line. If not set, the default is inherited from Width.

    Overrides
    ChartDefaultBorder.Width
    Remarks

    Adjusting the width alters the thickness of the crosshair line on the chart.

    Examples
    // This example demonstrates how to enable crosshair in a Chart and customize its line width.
    <SfChart>
        <ChartCrosshairSettings Enable="true">
            <ChartCrosshairLine Width="2" Color="blue"></ChartCrosshairLine>
        </ChartCrosshairSettings>
        <ChartSeriesCollection>
            <ChartSeries DataSource="@Data" XName="XValue" YName="YValue">
            </ChartSeries>
        </ChartSeriesCollection>
    </SfChart>

    Methods

    OnParametersSetAsync()

    Declaration
    protected override Task OnParametersSetAsync()
    Returns
    Type
    Task
    Overrides
    ComponentBase.OnParametersSetAsync()

    Implements

    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    In this article
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved