Getting Data From Plot

Nov 6, 2012 at 11:47 PM


I have a plot with 10 points and need to retrieve the data for the intermediate points from code much like the tracker does when clicking the plot series.

As an example...

I have 10 points making up the data points on a smoothed line series plot.

I need to be able to retrieve the data value for a point at an arbitrary point along the X-Axis (eg X=3.2) that falls on the smoothed plot.

I have looked through the code and cannot find a function that can retrieve this information easily without the user clicking the plot series.

Thanks in advance..

BTW: great plotting package, love it.

Nov 7, 2012 at 3:19 PM
Edited Nov 7, 2012 at 3:19 PM

The tracker only finds the nearest point, it does not interpolate. I don't think there is any interpolation functions implemented in the library yet.

But we need to add this for

Nov 7, 2012 at 6:20 PM


Thanks for the reply.

How can this be the case when, if you click on the smoothed plot curve the tracker gives you an X,Y value that is not in the original data set (ie it is smooth interpolated between the points) 

For example if I have 5 data points in the plot within a smoothed line series and I click anywhere on the series "between" the points I get a value at that point I clicked displayed by the tracker. I want to be able to get that calculated value from the series in code without the user clicking the line series.

If I want the value of the plot 1/6 of the way between the points (2.5,24) and (3.4,35) I need to be able to get this info from the plot without the user having to click 1/6 of the way between the points.

Nov 7, 2012 at 6:36 PM

It finds the *nearest* point, not necessary the point at the x-value of your mouse cursor.

You find the code in OxyPlot\Series\XYAxisSeries.cs method GetNearestInterpolatedPointInternal