Profile Picture

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

Posted By Kevin Harrison 4 Years Ago

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

Author
Message
Kevin Harrison
Question Posted 4 Years Ago
View Quick Profile
Supreme Being

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
Last Active: 3 Years Ago
Posts: 176, Visits: 1,865
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




Similar Topics


Reading This Topic