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?
- Hiroyuki Seki asked 5 years ago
- last edited 5 years ago
- You must login to post comments
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
- Andrew Burnett-Thompson answered 5 years ago
- last edited 5 years ago
-
Your code scs.ModifierSurface.TranslatePoint(point, scs) shows error. It says that scs is not IHitTestable.
-
it compiled here – maybe an error on my side. You can definitely use scs.RootGrid which is IHitTestable.
-
var translatedPoint = scs.ModifierSurface.TranslatePoint(point, scs.RootGrid); worked fine. Thanks.
- You must login to post comments
Please login first to submit.