Back to Devexpress

HotTrackEventArgs.AdditionalObject Property

corelibraries-devexpress-dot-xtracharts-dot-hottrackeventargs-4b2f346f.md

latest4.7 KB
Original Source

HotTrackEventArgs.AdditionalObject Property

Provides access to an object related to the object being hit. The returned value depends on the HotTrackEventArgs.Object type and hit point location.

Namespace : DevExpress.XtraCharts

Assembly : DevExpress.XtraCharts.v25.2.dll

NuGet Package : DevExpress.Charts

Declaration

csharp
public object AdditionalObject { get; }
vb
Public ReadOnly Property AdditionalObject As Object

Property Value

TypeDescription
Object

A Object value representing an additional object that relates to the one being hit.

|

Remarks

Use the AdditionalObject property, to access AxisTitle, AxisLabelItem and SeriesPoint objects in the ChartControl.ObjectHotTracked event handler, when the hit point falls within a region that represents the corresponding object on a diagram.

In situations different from those described above (e.g. when a user clicks another object), the AdditionalObject property returns null ( Nothing in Visual Basic).

Example

This example demonstrates how you can obtain an internal value of an AxisLabelItem (returned by the HotTrackEventArgs.AdditionalObject property) in the ChartControl.ObjectHotTracked event handler.

csharp
private void chartControl1_ObjectHotTracked(object sender, HotTrackEventArgs e) {
    if (e.AdditionalObject is AxisLabelItem) {
        MessageBox.Show(((AxisLabelItem)e.AdditionalObject).AxisValueInternal.ToString());
    }
}
vb
Private Sub chartControl1_ObjectHotTracked(ByVal sender As Object, _ 
ByVal e As HotTrackEventArgs) Handles chartControl1.ObjectHotTracked
    If TypeOf e.AdditionalObject Is AxisLabelItem Then
        MessageBox.Show((CType(e.AdditionalObject, AxisLabelItem)).AxisValueInternal.ToString())
    End If
End Sub

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the AdditionalObject property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-highlight-pivot-cells-that-correspond-to-a-series-point-on-hover/CS/WindowsApplication53/Form1.cs#L35

csharp
private void chartControl1_ObjectHotTracked(object sender, HotTrackEventArgs e){
    SeriesPoint point = e.AdditionalObject as SeriesPoint;
    if (point == null) {

winforms-highlight-pivot-cells-that-correspond-to-a-series-point-on-hover/VB/WindowsApplication53/Form1.vb#L41

vb
Private Sub chartControl1_ObjectHotTracked(ByVal sender As Object, ByVal e As HotTrackEventArgs)
    Dim point As SeriesPoint = TryCast(e.AdditionalObject, SeriesPoint)
    If point Is Nothing Then

See Also

Series Points

Axis Titles

Axis Labels

HotTrackEventArgs Class

HotTrackEventArgs Members

DevExpress.XtraCharts Namespace