Pre loader

Getting the Y-Value of a XY Line Series based on a draggable VerticalLineAnnotationViewModel

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

1
0

Regarding Andrews comment on my question in this thread: https://www.scichart.com/questions/wpf/hittest-with-mvvm#sabai-entity-content-13177.

Thanks Andrew,
actually I need to know which nearest Y-value my XY line series has at the given VerticalLineAnnotationViewModel position. I need this value only for some calculation no need to show this on screen.

I found this post:
https://www.scichart.com/questions/wpf/current-y-value-of-annotation

But neither your answer Andrew nor the suggested solution of Alitec Developer works for me. The VerticalSliceHitTest() returns always a HitTestInfo with default values and the FindIndex() approach is not suitable for me because I have unsorted data.

Version
5.4.0.12119
  • You must to post comments
0
0

Hi Ronald,

Thanks for your question. You have to pass screen coordinates (pixels) instead of chart coordinates (Annotation.X1, Y1) to VerticalSliceHitTest(..) method. So first you have to transform annotation X1,Y1 coordinates into screen coordinates using our CoordinateTransformation API. Please find more info in this documentation article.

Try it and let me know if it helps,

Best regards,
Yuriy

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies