Group: Forum Members
Last Active: 2 Years Ago
Posts: 0,
Visits: 78
|
Given a mouse position on a Cartesian chart, I can transform the point into a chart point using the following code: protected NPointD TransformMousePositionToChartPoint(NMouseEventArgs e) { var view2Scale = new NViewToScale2DTransformation(this.cartesianChart, (int)StandardAxis.PrimaryX, (int)StandardAxis.PrimaryY); var scalePoint = new NVector2DD(); view2Scale.Transform(new NPointF(e.X, e.Y), ref scalePoint); var transformedPoint = new NPointD(); transformedPoint.X = scalePoint.X; transformedPoint.Y = scalePoint.Y; return transformedPoint; }
Can I do the reverse? Given a point on the chart, can I transform it into a mouse position? If so, how?
|
Group: Forum Members
Last Active: Last Week
Posts: 3,054,
Visits: 4,009
|
Hi, Yes, you can do the opposite transformation using NScale2DToViewTransformation: NScale2DToViewTransformation transform = new NScale2DToViewTransformation(chart, (int)StandardAxis.PrimaryX, (int)StandardAxis.PrimaryY); Let us know if you have any questions.
Best Regards, Nevron Support Team
|