protected override RadRect ArrangeCore(RadRect rect)
        {
            double       radius    = rect.Width / 2;
            RadPoint     center    = rect.Center;
            AxisPlotInfo anglePlot = this.plotInfo;
            double       angle     = 0d;

            NumericalAxisPlotInfo numericalAnglePlot = anglePlot as NumericalAxisPlotInfo;

            if (numericalAnglePlot != null)
            {
                angle = numericalAnglePlot.ConvertToAngle();
            }
            else
            {
                CategoricalAxisPlotInfo categoricalAnglePlot = anglePlot as CategoricalAxisPlotInfo;
                if (categoricalAnglePlot != null)
                {
                    angle = categoricalAnglePlot.ConvertToAngle(this.GetChartArea <PolarChartAreaModel>());
                }
            }

            RadPoint arcPoint = RadMath.GetArcPoint(angle, center, radius);

            this.radialLine = new RadPolarVector()
            {
                Point = arcPoint, Angle = angle, Center = center
            };

            return(new RadRect(center, arcPoint));
        }
예제 #2
0
        protected override RadRect ArrangeCore(RadRect rect)
        {
            double   radius = rect.Width / 2;
            RadPoint center = rect.Center;
            NumericalAxisPlotInfo polarPlot = this.firstPlotInfo as NumericalAxisPlotInfo;
            double       pointRadius        = polarPlot.NormalizedValue * radius;
            AxisPlotInfo anglePlot          = this.secondPlotInfo;

            this.angle = 0d;

            NumericalAxisPlotInfo numericalAnglePlot = anglePlot as NumericalAxisPlotInfo;

            if (numericalAnglePlot != null)
            {
                this.angle = numericalAnglePlot.ConvertToAngle();
            }
            else
            {
                CategoricalAxisPlotInfo categoricalAnglePlot = anglePlot as CategoricalAxisPlotInfo;
                if (categoricalAnglePlot != null)
                {
                    this.angle = categoricalAnglePlot.ConvertToAngle(this.GetChartArea <PolarChartAreaModel>());
                }
            }

            RadPoint arcPosition = RadMath.GetArcPoint(this.angle, center, pointRadius);
            RadSize  desiredSize = this.Measure();

            return(new RadRect(arcPosition.X, arcPosition.Y, desiredSize.Width, desiredSize.Height));
        }
예제 #3
0
        protected override RadRect ArrangeCore(RadRect rect)
        {
            this.radius = rect.Width / 2;
            RadPoint center = rect.Center;

            AxisPlotInfo anglePlot1 = this.firstPlotInfo;
            double       angle1     = 0d;

            NumericalAxisPlotInfo numericalAnglePlot1 = anglePlot1 as NumericalAxisPlotInfo;

            if (numericalAnglePlot1 != null)
            {
                angle1 = numericalAnglePlot1.ConvertToAngle();
            }
            else
            {
                CategoricalAxisPlotInfo categoricalAnglePlot1 = anglePlot1 as CategoricalAxisPlotInfo;
                if (categoricalAnglePlot1 != null)
                {
                    angle1 = categoricalAnglePlot1.ConvertToAngle(this.GetChartArea <PolarChartAreaModel>());
                }
            }

            RadPoint arcPoint1 = RadMath.GetArcPoint(angle1, center, this.radius);

            this.polarVector1 = new RadPolarVector()
            {
                Point = arcPoint1, Angle = angle1, Center = center
            };

            AxisPlotInfo anglePlot2 = this.secondPlotInfo;
            double       angle2     = 0d;

            NumericalAxisPlotInfo numericalAnglePlot2 = anglePlot2 as NumericalAxisPlotInfo;

            if (numericalAnglePlot2 != null)
            {
                angle2 = numericalAnglePlot2.ConvertToAngle();
            }
            else
            {
                CategoricalAxisPlotInfo categoricalAnglePlot2 = anglePlot2 as CategoricalAxisPlotInfo;
                if (categoricalAnglePlot2 != null)
                {
                    angle2 = categoricalAnglePlot2.ConvertToAngle(this.GetChartArea <PolarChartAreaModel>());
                }
            }

            RadPoint arcPoint2 = RadMath.GetArcPoint(angle2, center, this.radius);

            this.polarVector2 = new RadPolarVector()
            {
                Point = arcPoint2, Angle = angle2, Center = center
            };

            return(rect);
        }
예제 #4
0
        internal override RadPoint ConvertDataToPoint(Tuple <object, object> data)
        {
            var pointRadius = double.NaN;

            if (this.primaryFirstAxis != null && this.primaryFirstAxis.isUpdated)
            {
                NumericalAxisPlotInfo plotInfo = this.primaryFirstAxis.CreatePlotInfo(data.Item1) as NumericalAxisPlotInfo;
                if (plotInfo != null)
                {
                    double radius = this.plotArea.layoutSlot.Width / 2;
                    pointRadius = plotInfo.NormalizedValue * radius;
                }
            }

            var pointAngle = double.NaN;

            if (this.primarySecondAxis != null && this.primarySecondAxis.isUpdated)
            {
                if (this.primarySecondAxis is CategoricalAxisModel)
                {
                    CategoricalAxisPlotInfo categoricalPlotInfo = this.primarySecondAxis.CreatePlotInfo(data.Item2) as CategoricalAxisPlotInfo;
                    if (categoricalPlotInfo != null)
                    {
                        pointAngle = categoricalPlotInfo.ConvertToAngle(this);
                    }
                }
                else
                {
                    NumericalAxisPlotInfo numericalPlotInfo = this.primarySecondAxis.CreatePlotInfo(data.Item2) as NumericalAxisPlotInfo;
                    if (numericalPlotInfo != null)
                    {
                        pointAngle = numericalPlotInfo.ConvertToAngle();
                    }
                }
            }

            return(RadMath.GetArcPoint(pointAngle, this.plotArea.layoutSlot.Center, pointRadius));
        }