Class ChartMouseEventArgs
Specifies the event arguments available on Mouse Events.
Inheritance
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 read only value.
MouseX
Defines the current MouseX.
Declaration
public double MouseX { get; set; }
Property Value
Type | Description |
---|---|
System.Double | Accepts the double value. |
MouseY
Defines the current MouseY.
Declaration
public double MouseY { get; set; }
Property Value
Type | Description |
---|---|
System.Double | Accepts the double value. |