Pre loader

WPF HitTest no longer available

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

0
0

Hello
We were using wpf version prior to 6, we just purchased new license and downloaded latest, but we found the HitTest api is gone, below is our code, it tries to figure out the line being clicked and get its data series.
Could you please let us know how to replace HitTest api?
Thanks

Sally

private void ChartPointClicked(object sender, MouseButtonEventArgs e)
{
e.Handled = true;

        Point mousePoint = e.GetPosition(Chart.GridLinesPanel as UIElement);
        double datapointRadius = 8;
        bool useInterpolation = false;
        HitTestInfo result;
        if (LineSeries.DataSeries != null)
            result = LineSeries.HitTest(mousePoint,datapointRadius, useInterpolation);
        else if (BoxSeries.DataSeries != null)
            result = BoxSeries.HitTest(mousePoint, datapointRadius, useInterpolation);
        else
            return;

        if (!result.IsHit)
            return;

        if (result.DataSeriesIndex <= Events.Count)
        {
            List<wExportEvent> runs = new List<wExportEvent>();
            runs = Events.Select(x => x.Wsdl).ToList();
            OpenRunSummary(runs, result.DataSeriesIndex);
        }
    }
Version
latest
  • You must to post comments
1
0

Hi Sally,

Thanks for your inquiry.
I am sorry for the misunderstanding. HitTest API is one of the core SciChart APIs and it’s still available.
Please take a look:
https://www.scichart.com/documentation/win/current/webframe.html#RenderableSeries%20APIs%20-%20Hit%20Testing.html

However, there might be some breaking changes depending on which SciChart version you have previously used.

Could you please specify your requirements so we can provide you with a proper solution?

Thanks in advance,
Lex,
SciChart Technical Support Engineer

  • You must to post comments
0
0

Hi Lex
We did find a work around using HitTestProvider like below:

LineSeries.HitTestProvider.VerticalSliceHitTest(mousePoint);

Is it possible the old HitTest was moved to another dll? Our previous version was quite old, date back at least 5 years ago.

Thanks.

Sally

  • You must to post comments
0
0

We found using new api works, code as below:

result =LineSeries.HitTestProvider.VerticalSliceHitTest(mousePoint);

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.