Questions

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 :

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?

I had a look at the Hit-Test code and because of the number of use-cases it has to satisfy (being fast, accurate, for many series types, on polar or normal charts, on data-points or interpolated) the code is pretty dense. I don’t really want to go in there and modify to output a value for Y=NaN (when some aspects of SciChart also rely on this, like Rollover, which should hide when Y=NaN).

However, I have a workaround for you so you can snap to the X-value and hopefully with only a few lines of code. Try this:

Hi Andrew. i know how you feel about code complexity :-(
I was happy enough for the Yvalue to come back as null or whatever, I was just surprised under these conditions what should have been a perfectly valid X value, was also coming back as a null. Anyway - your workaround works perfectly well thank you very much. I shall use your method :-)

It's mainly to do with - I don't know what else depends on that. I know for a fact Rollover is designed to disappear if the Y-Value is null because the series is also invisible at those points. I agree with you the behaviour of HitTest when Y=NaN is not intuitive but I don't want to change it when the above works perfectly well. Let me know if the issue is resolved! Best regards, Andrew