SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components
Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy. We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!
Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.
Thanks for the additional info! OK so you want to get the Intercept of the VerticalLineAnnotation with a series, is that right?
In that case you need to use our Hit-Test API.
Some code like this should do it:
// Starting with the X value of the VerticalLineAnnotaiton double x1 = verticalLineAnnotation.X1; // Perform a VerticalSliceHitTest on the series. Also see .HitTest() method for X,Y hit-tests whereas VerticalSliceHitTest considers X HitTestInfo hitTestResult = renderableLineSeries.VerticalSliceHitTest(new Point(x1, 0)); // Now you have the X,Y value of the series at the hit test site double xValueAtHit = (double)hitTestResult.XValue; double yValueAtHit = (double)hitTestResult.YValue; // And the screen coord Point xyCoordAtHit = hitTestResult.HitTestPoint;
I found solution:
var dataseries = this.ParentSurface.RenderableSeries.DataSeries; var index = dataseries.FindIndex(MainAnnotation.X1, SciChart.Charting.Common.Extensions.SearchMode.Nearest); var yValue = (IComparable)this.ParentSurface.RenderableSeries.DataSeries.YValues[index];
Please login first to submit.