12-03-2014 05:43 AM
Hi all!
WPF question.How to get the y-values from all plots of WPF Graph at the same known x-value (got the x-value from textbox)?
Thanks!
Solved! Go to Solution.
12-03-2014 08:51 AM
You can use the FindNearestValues
method to find the data values corresponding to a specified axis intercept across multiple plots. This method takes a relative value, so you will want to convert your raw data value using DataToRelative
first. For example:
var xAxis = ...;
double relativeValue = graph.DataToRelative( xAxis, xValue );
var query = new GraphQueryArgs( PlotsToSearch.Any, SearchDimensions.Horizontal, SearchDirections.ForwardAndReverse, isInclusive: true );
var foundValues = graph.FindNearestValues( xAxis, relativeValue, query );
foreach( PlotValue found in foundValues ) {
object x = found.Value[0];
object y = found.Value[1];
...
}
12-03-2014 11:34 AM
Thanks a lot Paul. It works like a charm.