internal SLDataLabelOptions Clone()
        {
            SLDataLabelOptions dlo = new SLDataLabelOptions(this.ShapeProperties.listThemeColors, this.ShapeProperties.ThrowExceptionsIfAny);

            dlo.Rotation           = this.Rotation;
            dlo.Vertical           = this.Vertical;
            dlo.Anchor             = this.Anchor;
            dlo.AnchorCenter       = this.AnchorCenter;
            dlo.HasNumberingFormat = this.HasNumberingFormat;
            dlo.sFormatCode        = this.sFormatCode;
            dlo.bSourceLinked      = this.bSourceLinked;
            dlo.vLabelPosition     = this.vLabelPosition;
            dlo.ShapeProperties    = this.ShapeProperties.Clone();
            dlo.ShowLegendKey      = this.ShowLegendKey;
            dlo.ShowValue          = this.ShowValue;
            dlo.ShowCategoryName   = this.ShowCategoryName;
            dlo.ShowSeriesName     = this.ShowSeriesName;
            dlo.ShowPercentage     = this.ShowPercentage;
            dlo.ShowBubbleSize     = this.ShowBubbleSize;
            dlo.Separator          = this.Separator;
            if (this.RichText != null)
            {
                dlo.RichText = this.RichText.Clone();
            }

            return(dlo);
        }
        internal SLDataLabelOptions Clone()
        {
            SLDataLabelOptions dlo = new SLDataLabelOptions(this.ShapeProperties.listThemeColors);
            dlo.Rotation = this.Rotation;
            dlo.Vertical = this.Vertical;
            dlo.Anchor = this.Anchor;
            dlo.AnchorCenter = this.AnchorCenter;
            dlo.HasNumberingFormat = this.HasNumberingFormat;
            dlo.sFormatCode = this.sFormatCode;
            dlo.bSourceLinked = this.bSourceLinked;
            dlo.vLabelPosition = this.vLabelPosition;
            dlo.ShapeProperties = this.ShapeProperties.Clone();
            dlo.ShowLegendKey = this.ShowLegendKey;
            dlo.ShowValue = this.ShowValue;
            dlo.ShowCategoryName = this.ShowCategoryName;
            dlo.ShowSeriesName = this.ShowSeriesName;
            dlo.ShowPercentage = this.ShowPercentage;
            dlo.ShowBubbleSize = this.ShowBubbleSize;
            dlo.Separator = this.Separator;
            if (this.RichText != null) dlo.RichText = this.RichText.Clone();

            return dlo;
        }
Exemple #3
0
        /// <summary>
        /// Set data label options to a specific data point in a specific data series.
        /// </summary>
        /// <param name="DataSeriesIndex">The index of the data series. This is 1-based indexing, so it's 1 for the 1st data series, 2 for the 2nd data series and so on.</param>
        /// <param name="DataPointIndex">The index of the data point. This is 1-based indexing, so it's 1 for the 1st data point, 2 for the 2nd data point and so on.</param>
        /// <param name="Options">Data label customization options.</param>
        public void SetDataLabelOptions(int DataSeriesIndex, int DataPointIndex, SLDataLabelOptions Options)
        {
            // why not just return if outside of range? Because I assume you counted wrongly.
            if (DataSeriesIndex < 1) DataSeriesIndex = 1;
            if (DataSeriesIndex > this.PlotArea.DataSeries.Count) DataSeriesIndex = this.PlotArea.DataSeries.Count;
            // to get it to 0-index
            --DataSeriesIndex;

            --DataPointIndex;
            if (DataPointIndex < 0) DataPointIndex = 0;
            this.PlotArea.DataSeries[DataSeriesIndex].DataLabelOptionsList[DataPointIndex] = Options.Clone();
        }