internal SLDataSeries Clone()
        {
            var ds = new SLDataSeries(Options.ShapeProperties.listThemeColors);

            ds.ChartType         = ChartType;
            ds.Index             = Index;
            ds.Order             = Order;
            ds.IsStringReference = IsStringReference;
            ds.StringReference   = StringReference.Clone();
            ds.NumericValue      = NumericValue;
            ds.Options           = Options.Clone();

            var keys = DataPointOptionsList.Keys.ToList();

            ds.DataPointOptionsList = new Dictionary <int, SLDataPointOptions>();
            foreach (var index in keys)
            {
                ds.DataPointOptionsList[index] = DataPointOptionsList[index].Clone();
            }

            if (GroupDataLabelOptions != null)
            {
                ds.GroupDataLabelOptions = GroupDataLabelOptions.Clone();
            }

            keys = DataLabelOptionsList.Keys.ToList();
            ds.DataLabelOptionsList = new Dictionary <int, SLDataLabelOptions>();
            foreach (var index in keys)
            {
                ds.DataLabelOptionsList[index] = DataLabelOptionsList[index].Clone();
            }

            ds.BubbleSize = BubbleSize.Clone();
            ds.AxisData   = AxisData.Clone();
            ds.NumberData = NumberData.Clone();

            return(ds);
        }
        internal C.PieChartSeries ToPieChartSeries(bool IsStylish = false)
        {
            var pcs = new C.PieChartSeries();

            pcs.Index = new C.Index {
                Val = Index
            };
            pcs.Order = new C.Order {
                Val = Order
            };

            if (IsStringReference != null)
            {
                pcs.SeriesText = new C.SeriesText();
                if (IsStringReference.Value)
                {
                    pcs.SeriesText.StringReference = StringReference.ToStringReference();
                }
                else
                {
                    pcs.SeriesText.NumericValue = new C.NumericValue(NumericValue);
                }
            }

            if (Options.ShapeProperties.HasShapeProperties)
            {
                pcs.ChartShapeProperties = Options.ShapeProperties.ToChartShapeProperties(IsStylish);
            }

            if (Options.iExplosion != null)
            {
                pcs.Explosion = new C.Explosion {
                    Val = Options.Explosion
                }
            }
            ;

            if (DataPointOptionsList.Count > 0)
            {
                var indexlist = DataPointOptionsList.Keys.ToList();
                indexlist.Sort();
                int index;
                for (var i = 0; i < indexlist.Count; ++i)
                {
                    index = indexlist[i];
                    pcs.Append(DataPointOptionsList[index].ToDataPoint(index, IsStylish));
                }
            }

            if ((GroupDataLabelOptions != null) || (DataLabelOptionsList.Count > 0))
            {
                if (GroupDataLabelOptions == null)
                {
                    var gdloptions = new SLGroupDataLabelOptions(new List <Color>());
                    pcs.Append(gdloptions.ToDataLabels(DataLabelOptionsList, true));
                }
                else
                {
                    pcs.Append(GroupDataLabelOptions.ToDataLabels(DataLabelOptionsList, false));
                }
            }

            pcs.Append(AxisData.ToCategoryAxisData());
            pcs.Append(NumberData.ToValues());

            return(pcs);
        }
        internal C.BubbleChartSeries ToBubbleChartSeries(bool IsStylish = false)
        {
            var bcs = new C.BubbleChartSeries();

            bcs.Index = new C.Index {
                Val = Index
            };
            bcs.Order = new C.Order {
                Val = Order
            };

            if (IsStringReference != null)
            {
                bcs.SeriesText = new C.SeriesText();
                if (IsStringReference.Value)
                {
                    bcs.SeriesText.StringReference = StringReference.ToStringReference();
                }
                else
                {
                    bcs.SeriesText.NumericValue = new C.NumericValue(NumericValue);
                }
            }

            if (Options.ShapeProperties.HasShapeProperties)
            {
                bcs.ChartShapeProperties = Options.ShapeProperties.ToChartShapeProperties(IsStylish);
            }

            bcs.InvertIfNegative = new C.InvertIfNegative {
                Val = Options.InvertIfNegative ?? false
            };

            if (DataPointOptionsList.Count > 0)
            {
                var indexlist = DataPointOptionsList.Keys.ToList();
                indexlist.Sort();
                int index;
                for (var i = 0; i < indexlist.Count; ++i)
                {
                    index = indexlist[i];
                    bcs.Append(DataPointOptionsList[index].ToDataPoint(index, IsStylish));
                }
            }

            if ((GroupDataLabelOptions != null) || (DataLabelOptionsList.Count > 0))
            {
                if (GroupDataLabelOptions == null)
                {
                    var gdloptions = new SLGroupDataLabelOptions(new List <Color>());
                    bcs.Append(gdloptions.ToDataLabels(DataLabelOptionsList, true));
                }
                else
                {
                    bcs.Append(GroupDataLabelOptions.ToDataLabels(DataLabelOptionsList, false));
                }
            }

            bcs.Append(AxisData.ToXValues());
            bcs.Append(NumberData.ToYValues());
            bcs.Append(BubbleSize.ToBubbleSize());

            if (Options.bBubble3D != null)
            {
                bcs.Append(new C.Bubble3D {
                    Val = Options.Bubble3D
                });
            }

            return(bcs);
        }
        internal C.ScatterChartSeries ToScatterChartSeries(bool IsStylish = false)
        {
            var scs = new C.ScatterChartSeries();

            scs.Index = new C.Index {
                Val = Index
            };
            scs.Order = new C.Order {
                Val = Order
            };

            if (IsStringReference != null)
            {
                scs.SeriesText = new C.SeriesText();
                if (IsStringReference.Value)
                {
                    scs.SeriesText.StringReference = StringReference.ToStringReference();
                }
                else
                {
                    scs.SeriesText.NumericValue = new C.NumericValue(NumericValue);
                }
            }

            if (Options.ShapeProperties.HasShapeProperties)
            {
                scs.ChartShapeProperties = Options.ShapeProperties.ToChartShapeProperties(IsStylish);
            }

            if (Options.Marker.HasMarker)
            {
                scs.Marker = Options.Marker.ToMarker(IsStylish);
            }

            if (DataPointOptionsList.Count > 0)
            {
                var indexlist = DataPointOptionsList.Keys.ToList();
                indexlist.Sort();
                int index;
                for (var i = 0; i < indexlist.Count; ++i)
                {
                    index = indexlist[i];
                    scs.Append(DataPointOptionsList[index].ToDataPoint(index, IsStylish));
                }
            }

            if ((GroupDataLabelOptions != null) || (DataLabelOptionsList.Count > 0))
            {
                if (GroupDataLabelOptions == null)
                {
                    var gdloptions = new SLGroupDataLabelOptions(new List <Color>());
                    scs.Append(gdloptions.ToDataLabels(DataLabelOptionsList, true));
                }
                else
                {
                    scs.Append(GroupDataLabelOptions.ToDataLabels(DataLabelOptionsList, false));
                }
            }

            scs.Append(AxisData.ToXValues());
            scs.Append(NumberData.ToYValues());

            scs.Append(new C.Smooth {
                Val = Options.Smooth
            });

            return(scs);
        }