[DevExpress]设置饼状图的Lable位置

关键代码:

        /// <summary>

        /// 设置饼状图的Lable位置

        /// </summary>

        /// <param name="series">Series</param>

        /// <param name="lablePosition">PieSeriesLabelPosition枚举</param>

        public static void SetLablePosition(this Series series, PieSeriesLabelPosition lablePosition)

        {

            if (series.Label is PieSeriesLabel)

            {

                PieSeriesLabel _label = series.Label as PieSeriesLabel;

                _label.Position = lablePosition;

            }

            //if (series.Label is Pie3DSeriesLabel)

            //{

            //    Pie3DSeriesLabel _label = series.Label as Pie3DSeriesLabel;

            //    _label.Position = lablePosition;

            //}



        }

运行效果:

image

你可能感兴趣的:(DevExpress)