How to trigger the ChartRegionEvents in the chart control?
The ChartRegionMouseEventHandler is used to raise the chart region related mouse events.
The Chart handles the following mouse related events when the user interacts with the Chart using the mouse on certain specific regions in the Chart - Axis Labels, Chart Points or a custom region.
- ChartRegionClick Event
- ChartRegionMouseEnter Event
- ChartRegionMouseHover Event
- ChartRegionMouseMove Event
- ChartRegionMouseLeave Event
- ChartRegionMouseUp Event
- ChartRegionMouseDown Event
C#
// Add the ChartRegionMouseDown event
this.chartControl1.ChartRegionMouseDown += new Syncfusion.Windows.Forms.Chart.ChartRegionMouseEventHandler(this.chartControl1_ChartRegionMouseDown);
//Specifies Action to the ChartRegionMouseDown Event
private void chartControl1_ChartRegionMouseDown(object sender, Syncfusion.Windows.Forms.Chart.ChartRegionMouseEventArgs e)
{
if(e.Region.SeriesIndex == 0 )
{
OutputText(String.Format("MouseDown Series 1 Bar {0} Point : {1}", e.Region.PointIndex, e.Point));
}
}
VB
' Add the ChartRegionMouseDown Event
AddHandler chartControl1.ChartRegionMouseDown, AddressOf chartControl1_ChartRegionMouseDown
'Specifies Action to the ChartRegionMouseDown Event
Private Sub chartControl1_ChartRegionMouseDown(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Chart.ChartRegionMouseEventArgs) Handles chartControl1.ChartRegionMouseDown
If e.Region.SeriesIndex = 0 Then
OutputText(String.Format("MouseDown Series 1 Bar {0} Point : {1}", e.Region.PointIndex, e.Point))
End If
End Sub ''chartControl1_ChartRegionMouseDown