Пример #1
0
        internal RadPoint ConvertDataToPoint(Tuple <object, object> data, AxisModel firstAxis, AxisModel secondAxis)
        {
            RadPoint coordinates = new RadPoint(double.NaN, double.NaN);

            if (this.view != null)
            {
                RadRect plotArea            = this.plotArea.layoutSlot;
                RadRect plotAreaVirtualSize = new RadRect(plotArea.X, plotArea.Y, plotArea.Width * this.view.ZoomWidth, plotArea.Height * this.view.ZoomHeight);

                if (firstAxis != null && this.FirstAxes.Contains(firstAxis) && firstAxis.isUpdated)
                {
                    AxisPlotInfo plotInfo = firstAxis.CreatePlotInfo(data.Item1);
                    if (plotInfo != null)
                    {
                        coordinates.X = plotInfo.CenterX(plotAreaVirtualSize);
                    }
                }

                if (secondAxis != null && this.SecondAxes.Contains(secondAxis) && secondAxis.isUpdated)
                {
                    AxisPlotInfo plotInfo = secondAxis.CreatePlotInfo(data.Item2);
                    if (plotInfo != null)
                    {
                        coordinates.Y = plotInfo.CenterY(plotAreaVirtualSize);
                    }
                }
            }

            return(coordinates);
        }
Пример #2
0
        protected static bool TryCreatePlotInfo(AxisModel axis, object value, out AxisPlotInfo plotInfo)
        {
            if (axis == null || value == null || !axis.isUpdated)
            {
                plotInfo = null;
                return(false);
            }

            plotInfo = axis.CreatePlotInfo(value);

            return(plotInfo != null);
        }