Exemplo n.º 1
0
        /// <summary>
        /// Method implementation for Create Adornments
        /// </summary>
        /// <param name="series">The series.</param>
        /// <param name="xVal">The x value.</param>
        /// <param name="yVal">The y value.</param>
        /// <param name="angle">The angle.</param>
        /// <param name="radius">The radius.</param>
        /// <param name="startDepth">The start depth.</param>
        /// <returns>Returns the created adornment</returns>
        protected static ChartAdornment CreateAdornment(ChartSeries3D series, double xVal, double yVal, double angle, double radius, double startDepth)
        {
            ChartPieAdornment3D adornment = new ChartPieAdornment3D(startDepth, xVal, yVal, angle, radius, series);

            adornment.XPos       = adornment.XData = xVal;
            adornment.YPos       = adornment.YData = yVal;
            adornment.Radius     = radius;
            adornment.Angle      = angle;
            adornment.Series     = series;
            adornment.StartDepth = startDepth;

            return(adornment);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Updates the series when selected index changed.
        /// </summary>
        /// <param name="d">The Dependency Object</param>
        /// <param name="e">The Event Arguments</param>
        private static void OnSelectedIndexChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ChartSeries3D series = d as ChartSeries3D;

            if (series.ActualArea == null)
            {
                return;
            }

            if ((series.ActualArea as SfChart3D).SelectionStyle == SelectionStyle3D.Single)
            {
                series.SelectedIndexChanged((int)e.NewValue, (int)e.OldValue);
            }
            else if ((int)e.NewValue != -1)
            {
                series.SelectedSegmentsIndexes.Add((int)e.NewValue);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PieSegment3D"/> class.
        /// </summary>
        /// <param name="series">The series.</param>
        /// <param name="center">The center.</param>
        /// <param name="start">The start.</param>
        /// <param name="end">The end.</param>
        /// <param name="height">The height.</param>
        /// <param name="r">The r.</param>
        /// <param name="i">The i.</param>
        /// <param name="y">The y.</param>
        /// <param name="insideRadius">The inside radius.</param>
        public PieSegment3D(ChartSeries3D series, Vector3D center, double start, double end, double height, double r, int i, double y, double insideRadius)
        {
            Points = new List <Point>();

            if (series.ToggledLegendIndex.Contains(i))
            {
                this.IsSegmentVisible = false;
            }
            else
            {
                this.IsSegmentVisible = true;
            }
            Series     = series3D = series as PieSeries3D;
            area       = series.Area;
            Item       = series.ActualData[i];
            StartValue = start;
            EndValue   = end;
            depth      = height;
            radius     = r;
            if (series3D != null)
            {
                pieIndex = series3D.GetPieSeriesIndex();
            }

            Index        = i;
            YData        = y;
            Center       = center;
            inSideRadius = insideRadius;
            if (series.CanAnimate)
            {
                return;
            }
            if (series3D.StartAngle < series3D.EndAngle)
            {
                ActualStartValue = start;
                ActualEndValue   = end - start;
            }
            else
            {
                ActualStartValue = end;
                ActualEndValue   = start - end;
            }
        }
Exemplo n.º 4
0
 /// <summary>
 /// Called when instance created for ChartPieAdornment
 /// </summary>
 /// <param name="xVal"></param>
 /// <param name="yVal"></param>
 /// <param name="angle"></param>
 /// <param name="radius"></param>
 /// <param name="series"></param>
 public ChartPieAdornment3D(double startDepth, double xVal, double yVal, double angle, double radius, ChartSeries3D series)
 {
     pieIndex = (from pieSeries in series.ActualArea.VisibleSeries where pieSeries is PieSeries3D select pieSeries).ToList().IndexOf(series);
 }