DXChartHitInfo Class
Chart hit test result storage.
Namespace: DevExpress.Xamarin.iOS.Charts
Assembly: DevExpress.Xamarin.iOS.Charts.dll
Declaration
public class DXChartHitInfo :
NSObject
Related API Members
The following members return DXChartHitInfo objects:
Example
The Hit test allows you to determine chart elements located under the specified screen coordinates. For example, the method allows you to know which chart element an end user taps:
public override void TouchesEnded(Foundation.NSSet touches,UIEvent evt) {
UITouch touch = (UITouch)touches.AnyObject;
CGPoint location = touch.LocationInView(this.chart);
DXChartHitInfo hitInfo = this.chart.CalcHitInfo(location);
bool useComma = false;
StringBuilder textBuilder = new StringBuilder("You tap");
if (hitInfo.InSeries) {
textBuilder.Append(" in a series");
useComma = true;
}
if (hitInfo.InPoint) {
if (useComma) {
textBuilder.Append(",");
}
textBuilder.Append(" in a point");
useComma = true;
}
if (hitInfo.InLegend) {
if (useComma) {
textBuilder.Append(",");
}
textBuilder.Append(" in the legend");
}
textBuilder.Append(".");
UIAlertController alertController = UIAlertController.Create(
title: "Series hit-testing",
message: textBuilder.ToString(),
preferredStyle: UIAlertControllerStyle.Alert
);
alertController.AddAction(
UIAlertAction.Create(
title: "OK",
style: UIAlertActionStyle.Default,
handler: null
)
);
this.PresentViewController(
viewControllerToPresent: alertController,
animated: true,
completionHandler: null
);
}
The following methods and classes allow you to perform hit testing.
Symbols | Description |
---|---|
Returns information about chart elements that are under the specified point. | |
| Chart hit test result storage. |
Inheritance
Object
Foundation.NSObject
DXChartHitInfo
See Also