Example #1
0
        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)));
        }
Example #2
0
        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);
                }
            }
        }
Example #3
0
 protected virtual CGPoint GetDrawPosition(double sourceX, double sourceY, IViewPort viewPort, IXAxis xAxis, IYAxis yAxis)
 => viewPort.DisplayPosition(new CGPoint(xAxis.GetContentValue(sourceX), yAxis.GetContentValue(sourceY)));