How to get event notification when clicking on an axis label in a WinForms Chart?
In Syncfusion WinForms Chart control, use the ChartAxisLabelClick event to retrieve the axis index, label index, and label text when a user clicks on an axis label. This event provides direct access to the clicked label's properties, enabling interactive chart experiences such as filtering data, displaying details, or navigating to related views.
this.chartControl1 = new ChartControl();
. . .
chartControl1.ChartAxisLabelClick += ChartControl1_ChartAxisLabelClick;
void ChartControl1_ChartAxisLabelClick(object sender, ChartRegionMouseEventArgs e)
{
MessageBox.Show("Axis Index: " + e.Region.AxisIndex);
}Me.ChartControl1 = New ChartControl()
. . .
AddHandler Me.ChartControl1.ChartAxisLabelClick, AddressOf ChartControl1_ChartAxisLabelClick
Private Sub ChartControl1_ChartAxisLabelClick(sender As Object, e As Syncfusion.Windows.Forms.Chart.ChartRegionMouseEventArgs)
MessageBox.Show("Axis Index: " & e.Region.AxisIndex.ToString(), "Axis Label Click")
End SubAlternatively, use the ChartRegionClick event as a workaround by comparing axis bounds with mouse coordinates. Since the Axes region provides the axis index but the AxesLabel region does not, this workaround enables you to detect which axis was clicked by manually checking if the click positions falls within each axis rectangle.
this.chartControl1 = new ChartControl();
. . .
chartControl1.ChartRegionClick += ChartControl1_ChartRegionClick;
void ChartControl1_ChartRegionClick(object sender, ChartRegionMouseEventArgs e)
{
var axis = this.chartControl1.Axes;
int x = e.Point.X;
int y = e.Point.Y;
for (int i = 0; i < axis.Count; i++)
{
if (x >= axis[i].Rect.X && x <= axis[i].Rect.X + axis[i].Rect.Width && y >= axis[i].Rect.Y && y <= axis[i].Rect.Y + axis[i].Rect.Height)
{
MessageBox.Show("Axis Index: " + i);
}
}
}Me.ChartControl1 = New ChartControl()
. . .
AddHandler Me.ChartControl1.ChartRegionClick, AddressOf ChartControl1_ChartRegionClick
Private Sub ChartControl1_ChartRegionClick(sender As Object, e As Syncfusion.Windows.Forms.Chart.ChartRegionMouseEventArgs)
Dim axes = Me.ChartControl1.Axes
Dim x As Integer = e.Point.X
Dim y As Integer = e.Point.Y
For i As Integer = 0 To axes.Count - 1
Dim r = axes(i).Rect
If (x >= r.X AndAlso x <= r.X + r.Width) AndAlso (y >= r.Y AndAlso y <= r.Y + r.Height) Then
MessageBox.Show("Axis Index: " & i.ToString(), "Axis Region Click")
Exit For
End If
Next
End SubThe index of the x-axis is displayed as 0, and the index of the y-axis is displayed as 1. The following screenshot illustrates the result when clicking on y-axis labels.
Output

Conclusion
I hope you enjoyed learning about how to get event notification when clicking on an axis label.
You can refer to our WinForms Chart feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started with configuration specifications. You can also explore our WinForms Chart examples to understand how to create and manipulate data.
For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our other controls.
If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!