menu

Blazor

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

    Show / Hide Table of Contents

    Class ChartMouseEventArgs

    Specifies the event arguments available on Mouse Events.

    Inheritance
    System.Object
    Syncfusion.Blazor.Charts.BaseEventArgs
    ChartMouseEventArgs
    Namespace: Syncfusion.Blazor.Charts
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class ChartMouseEventArgs : BaseEventArgs

    Properties

    AxisData

    Gets the axis values of the chart component when mouse events are triggered.

    Declaration
    public Dictionary<string, object> AxisData { get; }
    Property Value
    Type Description
    System.Collections.Generic.Dictionary<System.String, System.Object>

    The collection of axes data where the key is the axis name, and the value is the axis values for the location. The default value is null.

    Remarks

    This value is read-only and provides information about the axis values for chart interactions.

    Examples

    <SfChart> <ChartEvents ChartMouseClick = "MouseClick" ></ ChartEvents > < !--Chart Configuration --> </SfChart> @code { void MouseClick(ChartMouseEventArgs Args) { if (Args.AxisData.TryGetValue("PrimaryXAxis", out object xValue) && Args.AxisData.TryGetValue("PrimaryYAxis", out object yValue)) { AddToDataSource(xValue, yValue); } }

    void AddToDataSource(object xValue, object yValue) { // Add the X and Y values to the data source here. } }

    ID

    Gets the ID of the chart component when mouse events are triggered.

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

    The value of the chart component’s id. The default value is chart component’s auto generated id.

    Remarks

    It is a read only value.

    MouseX

    Gets or sets the X coordinate of the mouse pointer.

    Declaration
    public double MouseX { get; set; }
    Property Value
    Type Description
    System.Double

    Accepts the double value.

    Remarks

    Use this property to retrieve the horizontal position of the mouse pointer relative to the chart.

    MouseY

    Gets or sets the Y coordinate of the mouse pointer.

    Declaration
    public double MouseY { get; set; }
    Property Value
    Type Description
    System.Double

    Accepts the double value.

    Remarks

    Use this property to retrieve the vertical position of the mouse pointer relative to the chart.

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