Recent

Author Topic: Datapoint HintTool's PointIndex not updated for CubicSplineSeries  (Read 2627 times)

wp

  • Hero Member
  • *****
  • Posts: 11854
The DatapointHintTool gives access to the point index of the datapoint in the series over which the mouse is hovering. And when moving the mouse along the series the cursor is locked to the nearest data point if the the mouse cursor is sufficiently close. This behaviour is not true for the CubicSplineSeries. The OnDraw event of the tool always reports PointIndex = -1, and the cursor tracks the entire curve, not only the data points -- see attached demo. While the latter behaviour might be advantageous also for other interpolating series it would be good to have also the mode of locking to data points in which PointIndex is valid. The current behavior makes the TDatapointHintTool.OnDraw event handler querying data point values unnecessarily complicated if the user can change the interpolation type (linear segments, cubic spline, B-Spline).

wp

  • Hero Member
  • *****
  • Posts: 11854
Re: Datapoint HintTool's PointIndex not updated for CubicSplineSeries
« Reply #1 on: February 18, 2013, 12:42:43 am »
I tried to use the NearestGraphPoint property as a replacement. However this one has rounding errors for the BSplineSeries. See attached demo which uses data points at integer coordinates.

 

TinyPortal © 2005-2018