protected double GetDistance(CGPoint tapLocation, IPointEntry entry, IXAxis xAxis, IYAxis yAxis) { var entryContentLocationX = xAxis.GetContentValue(entry.X); var entryContentLocationY = yAxis.GetContentValue(entry.Y); return(Math.Sqrt(Math.Pow(entryContentLocationX - tapLocation.X, 2) + Math.Pow(entryContentLocationY - tapLocation.Y, 2))); }
private void DrawLabels(CGContext context, IViewPort viewPort, IXAxis xAxis, nfloat positionY, nfloat axisLineStart, nfloat axisLineEnd, TextStyle textStyle, List <Tuple <double, string> > labels) { foreach (var label in labels) { var labelX = xAxis.GetContentValue(label.Item1); var viewPortPositionX = viewPort.DisplayPositionX((nfloat)labelX); if (viewPortPositionX >= axisLineStart && viewPortPositionX <= axisLineEnd) { DrawLabel(context, label.Item2, new CGPoint(viewPortPositionX, positionY), textStyle); } } }
protected virtual CGPoint GetDrawPosition(double sourceX, double sourceY, IViewPort viewPort, IXAxis xAxis, IYAxis yAxis) => viewPort.DisplayPosition(new CGPoint(xAxis.GetContentValue(sourceX), yAxis.GetContentValue(sourceY)));