internal C.DataLabel ToDataLabel(int index)
        {
            C.DataLabel lbl = new C.DataLabel();

            lbl.Index = new C.Index() { Val = (uint)index };

            lbl.Append(new C.Layout());

            if (this.RichText != null || this.Rotation != null || this.Vertical != null || this.Anchor != null || this.AnchorCenter != null)
            {
                C.ChartText ctxt = new C.ChartText();
                ctxt.RichText = new C.RichText();
                ctxt.RichText.BodyProperties = new A.BodyProperties();

                if (this.Rotation != null || this.Vertical != null || this.Anchor != null || this.AnchorCenter != null)
                {
                    if (this.Rotation != null) ctxt.RichText.BodyProperties.Rotation = (int)(this.Rotation.Value * SLConstants.DegreeToAngleRepresentation);
                    if (this.Vertical != null) ctxt.RichText.BodyProperties.Vertical = this.Vertical.Value;
                    if (this.Anchor != null) ctxt.RichText.BodyProperties.Anchor = this.Anchor.Value;
                    if (this.AnchorCenter != null) ctxt.RichText.BodyProperties.AnchorCenter = this.AnchorCenter.Value;
                }

                ctxt.RichText.ListStyle = new A.ListStyle();

                if (this.RichText != null) ctxt.RichText.Append(this.RichText.ToParagraph());

                lbl.Append(ctxt);
            }

            if (this.HasNumberingFormat)
            {
                lbl.Append(new C.NumberingFormat() { FormatCode = this.FormatCode, SourceLinked = this.SourceLinked });
            }

            if (this.ShapeProperties.HasShapeProperties) lbl.Append(this.ShapeProperties.ToChartShapeProperties());

            if (this.vLabelPosition != null) lbl.Append(new C.DataLabelPosition() { Val = this.vLabelPosition.Value });

            lbl.Append(new C.ShowLegendKey() { Val = this.ShowLegendKey });
            lbl.Append(new C.ShowValue() { Val = this.ShowValue });
            lbl.Append(new C.ShowCategoryName() { Val = this.ShowCategoryName });
            lbl.Append(new C.ShowSeriesName() { Val = this.ShowSeriesName });
            lbl.Append(new C.ShowPercent() { Val = this.ShowPercentage });
            lbl.Append(new C.ShowBubbleSize() { Val = this.ShowBubbleSize });

            if (this.Separator != null && this.Separator.Length > 0) lbl.Append(new C.Separator() { Text = this.Separator });

            return lbl;
        }
        internal C.DataLabel ToDataLabel(int index)
        {
            C.DataLabel lbl = new C.DataLabel();

            lbl.Index = new C.Index()
            {
                Val = (uint)index
            };

            lbl.Append(new C.Layout());

            if (this.RichText != null || this.Rotation != null || this.Vertical != null || this.Anchor != null || this.AnchorCenter != null)
            {
                C.ChartText ctxt = new C.ChartText();
                ctxt.RichText = new C.RichText();
                ctxt.RichText.BodyProperties = new A.BodyProperties();

                if (this.Rotation != null || this.Vertical != null || this.Anchor != null || this.AnchorCenter != null)
                {
                    if (this.Rotation != null)
                    {
                        ctxt.RichText.BodyProperties.Rotation = (int)(this.Rotation.Value * SLConstants.DegreeToAngleRepresentation);
                    }
                    if (this.Vertical != null)
                    {
                        ctxt.RichText.BodyProperties.Vertical = this.Vertical.Value;
                    }
                    if (this.Anchor != null)
                    {
                        ctxt.RichText.BodyProperties.Anchor = this.Anchor.Value;
                    }
                    if (this.AnchorCenter != null)
                    {
                        ctxt.RichText.BodyProperties.AnchorCenter = this.AnchorCenter.Value;
                    }
                }

                ctxt.RichText.ListStyle = new A.ListStyle();

                if (this.RichText != null)
                {
                    ctxt.RichText.Append(this.RichText.ToParagraph());
                }

                lbl.Append(ctxt);
            }

            if (this.HasNumberingFormat)
            {
                lbl.Append(new C.NumberingFormat()
                {
                    FormatCode = this.FormatCode, SourceLinked = this.SourceLinked
                });
            }

            if (this.ShapeProperties.HasShapeProperties)
            {
                lbl.Append(this.ShapeProperties.ToChartShapeProperties(false));
            }

            if (this.vLabelPosition != null)
            {
                lbl.Append(new C.DataLabelPosition()
                {
                    Val = this.vLabelPosition.Value
                });
            }

            lbl.Append(new C.ShowLegendKey()
            {
                Val = this.ShowLegendKey
            });
            lbl.Append(new C.ShowValue()
            {
                Val = this.ShowValue
            });
            lbl.Append(new C.ShowCategoryName()
            {
                Val = this.ShowCategoryName
            });
            lbl.Append(new C.ShowSeriesName()
            {
                Val = this.ShowSeriesName
            });
            lbl.Append(new C.ShowPercent()
            {
                Val = this.ShowPercentage
            });
            lbl.Append(new C.ShowBubbleSize()
            {
                Val = this.ShowBubbleSize
            });

            if (this.Separator != null && this.Separator.Length > 0)
            {
                lbl.Append(new C.Separator()
                {
                    Text = this.Separator
                });
            }

            return(lbl);
        }
        internal C.DataLabel ToDataLabel(int index)
        {
            var lbl = new C.DataLabel();

            lbl.Index = new C.Index {
                Val = (uint)index
            };

            lbl.Append(new C.Layout());

            if ((RichText != null) || (Rotation != null) || (Vertical != null) || (Anchor != null) ||
                (AnchorCenter != null))
            {
                var ctxt = new C.ChartText();
                ctxt.RichText = new C.RichText();
                ctxt.RichText.BodyProperties = new A.BodyProperties();

                if ((Rotation != null) || (Vertical != null) || (Anchor != null) || (AnchorCenter != null))
                {
                    if (Rotation != null)
                    {
                        ctxt.RichText.BodyProperties.Rotation =
                            (int)(Rotation.Value * SLConstants.DegreeToAngleRepresentation);
                    }
                    if (Vertical != null)
                    {
                        ctxt.RichText.BodyProperties.Vertical = Vertical.Value;
                    }
                    if (Anchor != null)
                    {
                        ctxt.RichText.BodyProperties.Anchor = Anchor.Value;
                    }
                    if (AnchorCenter != null)
                    {
                        ctxt.RichText.BodyProperties.AnchorCenter = AnchorCenter.Value;
                    }
                }

                ctxt.RichText.ListStyle = new A.ListStyle();

                if (RichText != null)
                {
                    ctxt.RichText.Append(RichText.ToParagraph());
                }

                lbl.Append(ctxt);
            }

            if (HasNumberingFormat)
            {
                lbl.Append(new C.NumberingFormat {
                    FormatCode = FormatCode, SourceLinked = SourceLinked
                });
            }

            if (ShapeProperties.HasShapeProperties)
            {
                lbl.Append(ShapeProperties.ToChartShapeProperties());
            }

            if (vLabelPosition != null)
            {
                lbl.Append(new C.DataLabelPosition {
                    Val = vLabelPosition.Value
                });
            }

            lbl.Append(new C.ShowLegendKey {
                Val = ShowLegendKey
            });
            lbl.Append(new C.ShowValue {
                Val = ShowValue
            });
            lbl.Append(new C.ShowCategoryName {
                Val = ShowCategoryName
            });
            lbl.Append(new C.ShowSeriesName {
                Val = ShowSeriesName
            });
            lbl.Append(new C.ShowPercent {
                Val = ShowPercentage
            });
            lbl.Append(new C.ShowBubbleSize {
                Val = ShowBubbleSize
            });

            if ((Separator != null) && (Separator.Length > 0))
            {
                lbl.Append(new C.Separator {
                    Text = Separator
                });
            }

            return(lbl);
        }