Chart3DControl.CalcHitInfo(Point) Method
In This Article
Returns information on the chart elements located at the specified point.
Namespace: DevExpress.Xpf.Charts
Assembly: DevExpress.Xpf.Charts.v24.2.dll
NuGet Package: DevExpress.Wpf.Charts
#Declaration
public Chart3DHitInfo CalcHitInfo(
Point point
)
#Parameters
Name | Type | Description |
---|---|---|
point | Point | The test point coordinates relative to the top-left corner of the chart. |
#Returns
Type | Description |
---|---|
Chart3DHit |
The information about chart elements located at the test point. |
#Example
This example shows coordinates for a surface point and series point marker clicked in a 3D chart:
using DevExpress.Xpf.Charts;
using System.Windows;
//...
private void Chart3DControl_MouseUp(object sender, System.Windows.Input.MouseButtonEventArgs e) {
Chart3DHitInfo hitInfo = chart.CalcHitInfo(e.GetPosition(this));
if (hitInfo.InSeries) {
string str;
if (hitInfo.SeriesPoint != null) {
SeriesPoint3D point = hitInfo.SeriesPoint;
str = $"X: {point.NumericXArgument:f2}, Y: {point.NumericYArgument:f2}, Z: {point.Value:f2}";
MessageBox.Show(str);
}
if (hitInfo.AdditionalItem != null) {
SurfacePoint surfacePoint = (SurfacePoint)hitInfo.AdditionalItem;
str = $"X: {surfacePoint.X:f2}, Y: {surfacePoint.Y:f2}, Z: {surfacePoint.Z:f2}";
MessageBox.Show(str);
}
}
}
See Also