This example demonstrates how to implement custom hot-tracking and selection of the chart's elements at runtime.
Note
To enable runtime hot-tracking and selection, the RuntimeSelection property should be set to true.
If you want to change the default hot-tracking and selection, you should handle the ObjectHotTracked and ObjectSelected events, implement your custom hot-tracking and selection approaches and set the Cancel property to true.
For example, the code below illustrates how to disable selection and hot-tracking of a chart's Diagram.
C# |
using DevExpress.XtraCharts;
private void chartControl1_ObjectHotTracked(object sender, HotTrackEventArgs e) {
if (e.Object is Diagram)
e.Cancel = true;
}
private void chartControl1_ObjectSelected(object sender, HotTrackEventArgs e) {
if (e.Object is Diagram)
e.Cancel = true;
}
|
VB |
Imports DevExpress.XtraCharts
Private Sub OnObjectHotTracked(sender As Object, e As HotTrackEventArgs) _
Handles ChartControl1.ObjectHotTracked
If TypeOf e.Object Is Diagram Then
e.Cancel = True
End If
End Sub
Private Sub OnObjectSelected(sender As Object, e As HotTrackEventArgs) _
Handles ChartControl1.ObjectSelected
If TypeOf e.Object Is Diagram Then
e.Cancel = True
End If
End Sub
|