SciChart Xamarin.iOS:PointMarker 点击事件

SciChart Xamarin.iOS: PointMarker Tap Event

当我们点击点标记或数据点时,是否可以捕获点击事件?我可以看到 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 中的原理是相同的。