Pre loader

ICoordinateCalculator.TransformDataToIndex for many series

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


I have two series on chart. I need to obtain data index for particular position. The problem is that ICoordinateCalculator.TransformDataToIndex seems to work only for first data serie in chart. It yields correct indexes as long as dataValue is in first data serie range. Outside that range it returns max/min index of this serie.

What I need is to obtain Y data values for particular X data value for all series. I tried using that function to get index and then read Y value from DataSerie, but maybe there is other approach for this issue.

  • You must to post comments

Hi Anth,

The XML comment documentation for ICoordinateCalculator.TransformDataToIndex says this:

Takes a DateTime data-value and transforms to integer index on the axis e.g. if the axis is a CategoryDateTimeAxis, accepts DateTime, returns index. If the DateTime lies outside of the data-range, a projection is performed

We didn’t intend it to be used for all axis types (only CategoryDateTimeAxis to transform between DateTime and data index), although, it does seem pretty intuitive to pick up this method and use it, so I can’t blame you!

If you want to get the Y-value on a specific series for a specific X-Value, please use the RenderableSeries.HitTest method instead. Please can you call this as follows:

bool interpolateBetweenDataPoints = false; // If false, snaps to points. If true, snaps to line (between points)
var hitTestInfo = renderableSeries.HitTest(currentPoint, interpolateBetweenDataPoints);

Finally, the documentation for HitTestInfo is here.

Best regards,

  • anth
    Ok Thanks. I have to start read documentation ;)
  • Andrew Burnett-Thompson
    Did it work for you? Hope you get it sorted, Andrew
  • 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