Hi,
Is there a way to get the DataPoint underlaying a SeriesPoint in a FreeformPointLineSeries?
Kind regards.
How to get DataPoint from PointSeries
Moderator: Queue Moderators
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: How to get DataPoint from PointSeries
Hi,
- freeFormPointLineSeries.SolveNearestDataPointByCoord to solve nearest point to screen coordinate (mouse location)
- freeFormPointLineSeries.SolveNearestDataPointByValue to solve nearest point to X,Y value.
- freeFormPointLineSeries.SolveNearestDataPointByCoord to solve nearest point to screen coordinate (mouse location)
- freeFormPointLineSeries.SolveNearestDataPointByValue to solve nearest point to X,Y value.
LightningChart Support Team, PT
Re: How to get DataPoint from PointSeries
Hi,
I already used those functions but I have unexpected result.
Point p = e.GetPosition(sender as IInputElement);
double nearestPointXValue = 0;
double nearestPointYValue = 0;
int nearestIndex = 0;
bool result = poiPointsSerie.SolveNearestDataPointByCoord((int)p.X, (int)p.Y, out nearestPointXValue, out nearestPointYValue, out nearestIndex);
double xValue = 0;
double yValue = 0;
chart.ViewXY.XAxes[0].CoordToValue((int)p.X, out xValue, true);
chart.ViewXY.YAxes[0].CoordToValue((float)p.Y, out yValue);
result = poiPointsSerie.SolveNearestDataPointByValue(xValue, yValue, out nearestPointXValue, out nearestPointYValue, out nearestIndex);
Kind regards
I already used those functions but I have unexpected result.
Point p = e.GetPosition(sender as IInputElement);
double nearestPointXValue = 0;
double nearestPointYValue = 0;
int nearestIndex = 0;
bool result = poiPointsSerie.SolveNearestDataPointByCoord((int)p.X, (int)p.Y, out nearestPointXValue, out nearestPointYValue, out nearestIndex);
double xValue = 0;
double yValue = 0;
chart.ViewXY.XAxes[0].CoordToValue((int)p.X, out xValue, true);
chart.ViewXY.YAxes[0].CoordToValue((float)p.Y, out yValue);
result = poiPointsSerie.SolveNearestDataPointByValue(xValue, yValue, out nearestPointXValue, out nearestPointYValue, out nearestIndex);
Kind regards
- ArctionPasi
- Posts: 1367
- Joined: Tue Mar 26, 2013 10:57 pm
- Location: Finland
- Contact:
Re: How to get DataPoint from PointSeries
Can you be more specific, what is unexpected?
Please take a look at "Scatter, point tracking" example in the demo app.
Please take a look at "Scatter, point tracking" example in the demo app.
LightningChart Support Team, PT