Getting x,y coordinates on an axis line and of an axis label


Author
Message
Kevin Harrison 1
Kevin Harrison 1
Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)
Group: Forum Members
Posts: 176, Visits: 1.9K
Hi guys

We've added functionality where clicking on an axis (hitTestResult.ChartElement == ChartElement.Axis) brings up a context menu. We'd now like to test this by simulating a click in the axis area and therefore need to calculate x,y coordinates.

For points within the chart we already have
private Point CartesianChartPixelCoordinates(NChart nevronChart, int horizontalAxisId, int verticalAxisId, double xValue, double yValue)
   {
    NScale2DToViewTransformation scale2DToViewTransformation = new NScale2DToViewTransformation(nevronControl.View.Context, nevronChart, horizontalAxisId, verticalAxisId);
    NPointF viewPoint = new NPointF();
    scale2DToViewTransformation.Transform(new NVector2DD(xValue, yValue), ref viewPoint);
    return new Point((int) viewPoint.X, (int) viewPoint.Y);
   }

We could use this to click on the axis line (if we got the minimum value displayed on the axis) but is there is an alternative you can suggest to click on the axis label, for instance?

Thanks
Kevin
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search