当我们点击点标记或数据点时,是否可以捕获点击事件?我可以看到WPF有一个DataPointSelectionModifier,但iOS没有。我们的目标是在用户点击标记时在其上显示一个弹出窗口(工具提示)。
谢谢,拉扎尔·尼科洛夫
Xamarin.iOS软件包版本:2.2.2.854
您正在寻找的API称为Hit-Test API。
在最新版本(sciChart iOS v3)中,documentation link is here:
private void HandleSingleTap(UITapGestureRecognizer recognizer)
{
// The touch point relative to the SCIChartSurface
var location = recognizer.LocationInView(recognizer.View.Superview);
// Translate the touch point relative to RenderableSeriesArea (or ModifierSurface)
var hitTestPoint = SciChartSurface.TranslatePoint(location, Surface.RenderableSeriesArea);
// Perform `Hit-Test` which will be stored in the `_hitTestInfo`
renderableSeries.HitTest(_hitTestInfo, hitTestPoint);
}
我们还有一个示例,显示了如何使用Hit-Test API here。它是Swift,但是Xamarin中的原理是相同的。