Pre loader

How can I convert XYAxis value to chart surface coodinate?

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

Answered
0
0

I want to convert XorYAxis value to total chart surface coodinate Point(X, Y), that includes the axises width too.
(Not chart modifier surface coodinate)

How can I get it?

Version
v5.1.1.11473
  • You must to post comments
Great Answer
1
0

First, get the point relative to the ChartModifierSurface by using our Coordinate Transformation API

Next, you can get that point relative to the parent SciChartSurface by using TransformPoint.

For example, try this:

        SciChartSurface scs;
        // Gets a coordinate on the ChartModifierSurface by datavalues 
        Point point = new Point(scs.XAxis.GetCoordinate(xDataValue),
            scs.YAxis.GetCoordinate(yDataValue));

        // Translates that point back to the parent surface's root element
        var translatedPoint = scs.ModifierSurface.TranslatePoint(point, scs.RootGrid);

Let me know if this helps,

Best regards
Andrew

  • Hiroyuki Seki
    Your code scs.ModifierSurface.TranslatePoint(point, scs) shows error. It says that scs is not IHitTestable.
  • Andrew Burnett-Thompson
    it compiled here – maybe an error on my side. You can definitely use scs.RootGrid which is IHitTestable.
  • Hiroyuki Seki
    var translatedPoint = scs.ModifierSurface.TranslatePoint(point, scs.RootGrid); worked fine. Thanks.
  • 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