本文整理汇总了C#中Series.GetNearestPoint方法的典型用法代码示例。如果您正苦于以下问题:C# Series.GetNearestPoint方法的具体用法?C# Series.GetNearestPoint怎么用?C# Series.GetNearestPoint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Series
的用法示例。
在下文中一共展示了Series.GetNearestPoint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetNearestHit
/// <summary>
/// Gets the nearest tracker hit.
/// </summary>
/// <param name="series">The series.</param>
/// <param name="point">The point.</param>
/// <param name="snap">Snap to points.</param>
/// <param name="pointsOnly">Check points only (no interpolation).</param>
/// <returns>A tracker hit result.</returns>
private static TrackerHitResult GetNearestHit(Series.Series series, ScreenPoint point, bool snap, bool pointsOnly)
{
if (series == null)
{
return null;
}
// Check data points only
if (snap || pointsOnly)
{
var result = series.GetNearestPoint(point, false);
if (result != null)
{
if (result.Position.DistanceTo(point) < 20)
{
return result;
}
}
}
// Check between data points (if possible)
if (!pointsOnly)
{
var result = series.GetNearestPoint(point, true);
return result;
}
return null;
}