corelibraries-devexpress-dot-xtracharts-dot-charthitinfobase-c2b08736.md
Gets an axis title which is located under the test point.
Namespace : DevExpress.XtraCharts
Assembly : DevExpress.XtraCharts.v25.2.dll
NuGet Package : DevExpress.Charts
public AxisTitle AxisTitle { get; }
Public ReadOnly Property AxisTitle As AxisTitle
| Type | Description |
|---|---|
| AxisTitle |
An AxisTitle object which represents the axis title located under the test point.
|
Use the AxisTitle property to access the axis title located under the test point if the ChartHitInfo.InAxis property returns true.
Note
The AxisTitle property returns null ( Nothing in Visual Basic), if the ChartHitInfoBase.InAxis property is set to false. The AxisTitle property isn’t null only if the mouse pointer actually hovers over an axis title, so the AxisTitle property may return null even if the ChartHitInfoBase.InAxis property is set to true.
For more information, refer to Axis Titles.
This example demonstrates how you can determine whether an axis title is being hovered by the mouse pointer, and if so, display its type (AxisTitleX or AxisTitleY) in a tooltip.
using DevExpress.XtraCharts;
using System;
using System.Windows.Forms;
namespace AxisTitleHitTestSample {
public partial class SampleForm : Form {
public SampleForm() {
InitializeComponent();
}
private void OnMouseMove(object sender, MouseEventArgs e) {
ChartHitInfo hitInfo = chart.CalcHitInfo(e.X, e.Y);
if (hitInfo.AxisTitle != null)
tooltipController.ShowHint(
String.Format(
"The pointer is over the {0} object.",
hitInfo.AxisTitle.GetType().ToString()
)
);
else
tooltipController.HideHint();
}
}
}
Imports DevExpress.XtraCharts
Imports System
Imports System.Windows.Forms
Namespace AxisTitleHitTestSample
Partial Public Class SampleForm
Inherits Form
Public Sub New()
InitializeComponent()
End Sub
Private Overloads Sub OnMouseMove(ByVal sender As Object, ByVal e As MouseEventArgs) Handles chart.MouseMove
Dim hitInfo As ChartHitInfo = chart.CalcHitInfo(e.X, e.Y)
If hitInfo.AxisTitle IsNot Nothing Then
tooltipController.ShowHint(String.Format("The pointer is over the {0} object.", hitInfo.AxisTitle.GetType().ToString()))
Else
tooltipController.HideHint()
End If
End Sub
End Class
End Namespace
See Also