コード例 #1
0
ファイル: PolarChartGrid.cs プロジェクト: zach14c/UI-For-UWP
        private void ArrangeRadialLines()
        {
            // update radial lines (ellipses)
            int radialLinesIndex = 0;

            if ((this.linesVisibility & PolarGridLineVisibility.Radial) == PolarGridLineVisibility.Radial)
            {
                int count = this.model.radialLines.Count - 1;
                for (int i = 1; i < count; i++, radialLinesIndex++)
                {
                    RadCircle circle  = this.model.radialLines[i];
                    Ellipse   ellipse = this.GetEllipse(radialLinesIndex);
                    RadRect   rect    = circle.Bounds;

                    Canvas.SetLeft(ellipse, rect.X);
                    Canvas.SetTop(ellipse, rect.Y);
                    ellipse.Width  = rect.Width;
                    ellipse.Height = rect.Height;
                }
            }

            // hide not used ellipses
            while (radialLinesIndex < this.radialLines.Count)
            {
                this.radialLines[radialLinesIndex].Visibility = Visibility.Collapsed;
                radialLinesIndex++;
            }
        }
コード例 #2
0
        protected override RadRect ArrangeCore(RadRect rect)
        {
            double   radius = rect.Width / 2;
            RadPoint center = rect.Center;
            double   normalizedValue1, normalizedValue2;

            var annotationPresenter = this.presenter as PolarAxisPlotBandAnnotation;

            NumericalAxisPlotInfo polarPlot1 = this.firstPlotInfo as NumericalAxisPlotInfo;
            NumericalAxisPlotInfo polarPlot2 = this.secondPlotInfo as NumericalAxisPlotInfo;

            normalizedValue1 = polarPlot1.NormalizedValue;
            normalizedValue2 = polarPlot2.NormalizedValue;

            if (annotationPresenter != null && annotationPresenter.ClipToPlotArea)
            {
                if (normalizedValue1 > 1 && normalizedValue2 > 1)
                {
                    // annotation should not be visualized
                    this.circle1 = new RadCircle();
                    this.circle2 = new RadCircle();
                    return(new RadRect());
                }
                else
                {
                    normalizedValue1 = Math.Min(1, polarPlot1.NormalizedValue);
                    normalizedValue2 = Math.Min(1, polarPlot2.NormalizedValue);
                }
            }

            this.circle1 = new RadCircle(center, normalizedValue1 * radius);
            this.circle2 = new RadCircle(center, normalizedValue2 * radius);

            return(rect);
        }
コード例 #3
0
        protected override RadRect ArrangeCore(RadRect rect)
        {
            double   radius = rect.Width / 2;
            RadPoint center = rect.Center;
            NumericalAxisPlotInfo polarPlot = this.plotInfo as NumericalAxisPlotInfo;
            double pointRadius = polarPlot.NormalizedValue * radius;

            this.polarLine = new RadCircle(center, pointRadius);

            return(this.polarLine.Bounds);
        }
コード例 #4
0
ファイル: PolarChartGrid.cs プロジェクト: zach14c/UI-For-UWP
        private static Geometry BuildRadialStripe(RadCircle circle, RadCircle previousCircle)
        {
            DoughnutSegmentData segment = new DoughnutSegmentData()
            {
                Center     = new RadPoint(circle.Center.X + 0.5, circle.Center.Y + 0.5),
                Radius1    = circle.Radius + 0.5,
                Radius2    = previousCircle.Radius - 0.5,
                StartAngle = 0,
                SweepAngle = 359.99 // 360 does not render properly
            };

            if (segment.Radius1 < 0)
            {
                segment.Radius1 = 0;
            }
            if (segment.Radius2 < 0)
            {
                segment.Radius2 = 0;
            }

            return(DoughnutSegmentRenderer.RenderArc(segment));
        }