Pre loader

Tag: VerticalSliceHitTest

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 vote
7k views

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.

  • Roland D asked 4 years ago
  • last active 1 year ago
0 votes
10k views

In the Knowledge Base, an article discusses a rollover modifier that utilises a vertical hit test to draw a vertical line at the cursor and highlight the nearest point: http://support.scichart.com/index.php?/Knowledgebase/Article/View/17235/32/custom-chartmodifiers—part-1—creating-a-custom-rollover-modifier

This is perfect for data which moves/is unique along the X axis (such as time series data).

How can I best replicate this modifier for data which moves/is unique along the Y axis? Drawing a horizontal line is easy, but there is no HorizontalSliceHitTest function.

  • Rick C asked 7 years ago
  • last active 7 years ago
1 vote
11k views

Hi,

I have a dataseries I need to display on a log Axis – i have stripped out the <= 0 Y values and replaced them with NaN’s and set the chart to draw NaN’s as gaps which is all working as expected. The axis is a datetime x-axis and I’m plotting several Scatterseries on it.
I have a VerticalSliceModifier which the user sets to a particular point and the X value of that point is used to acquire further information from the database so for this feature the Y value is of no interest. I’ve overridden the MoveAnnotationTo() method in order to get the slicemodfier to “snap” to the next nearest point of any of the series shown.In order to do this I use :

HitTestInfo hitTestResult = _seriesToSnapTo.VerticalSliceHitTest(new Point(coordinates.X1Coord + horizOffset, 1));

The problem is that if the point is one of those with a Y Value of NaN the HitTestResult comes back as everything being “null” and I can’t get the XAxis Value i need.

I would have expected the HitTest to have returned an X value regardless of the Y value being a NaN. I really just want to snap to the next X Axis point ignoring the Y value. Is there something else I should be using to get the next X-axis point I need?

Showing 3 results

Try SciChart Today

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

Start TrialCase Studies