Пример #1
0
        internal override void TransformTick(AxisTickModel tick, FrameworkElement visual)
        {
            PolarChartAreaModel chartAreaModel = this.chart.chartArea as PolarChartAreaModel;
            double startAngle = chartAreaModel.StartAngle;

            visual.RenderTransformOrigin = new Point(0.5, 0);
            double rotationAngle = chartAreaModel.AngleAxis.IsInverse ? startAngle : 360 - startAngle;

            visual.RenderTransform = new RotateTransform()
            {
                Angle = rotationAngle
            };
        }
Пример #2
0
        internal override void UpdateAxisLine(ChartLayoutContext context)
        {
            PolarChartAreaModel chartArea = this.chart.chartArea as PolarChartAreaModel;
            double   angle  = chartArea.NormalizeAngle(0);
            RadPoint center = chartArea.plotArea.layoutSlot.Center;
            RadPoint point  = RadMath.GetArcPoint(angle, center, chartArea.plotArea.layoutSlot.Width / 2);

            double antiAliasOffset = this.model.LineThickness % 2 == 1 ? 0.5 : 0;

            this.line.X1 = center.X;
            this.line.Y1 = center.Y - antiAliasOffset;
            this.line.X2 = point.X;
            this.line.Y2 = point.Y - antiAliasOffset;

            base.UpdateAxisLine(context);
        }
Пример #3
0
        private void ArrangePolarStripes()
        {
            int polarStripeIndex = 0;

            if ((this.stripesVisibility & PolarGridLineVisibility.Polar) == PolarGridLineVisibility.Polar)
            {
                RadPolarVector      vector;
                RadPolarVector      nextVector;
                PolarChartAreaModel polarChartAreaModel = this.chart.chartArea as PolarChartAreaModel;
                bool largeArc = (polarChartAreaModel.AngleAxis as IRadialAxis).IsLargeArc;

                int stripeCount = this.model.polarLines.Count;

                for (; polarStripeIndex < stripeCount; polarStripeIndex++)
                {
                    vector = this.model.polarLines[polarStripeIndex];
                    if (polarStripeIndex < stripeCount - 1)
                    {
                        nextVector = this.model.polarLines[polarStripeIndex + 1];
                    }
                    else
                    {
                        nextVector = this.model.polarLines[0];
                    }

                    Path path = this.GetPolarStripe(polarStripeIndex);
                    path.Data = this.BuildPolarStripe(vector, nextVector, largeArc);
                }
            }

            // hide not used paths
            while (polarStripeIndex < this.polarStripes.Count)
            {
                this.polarStripes[polarStripeIndex].Visibility = Visibility.Collapsed;
                polarStripeIndex++;
            }
        }