internal SLGroupDataLabelOptions Clone()
        {
            SLGroupDataLabelOptions gdlo = new SLGroupDataLabelOptions(this.ShapeProperties.listThemeColors);
            gdlo.Rotation = this.Rotation;
            gdlo.Vertical = this.Vertical;
            gdlo.Anchor = this.Anchor;
            gdlo.AnchorCenter = this.AnchorCenter;
            gdlo.HasNumberingFormat = this.HasNumberingFormat;
            gdlo.sFormatCode = this.sFormatCode;
            gdlo.bSourceLinked = this.bSourceLinked;
            gdlo.vLabelPosition = this.vLabelPosition;
            gdlo.ShapeProperties = this.ShapeProperties.Clone();
            gdlo.ShowLegendKey = this.ShowLegendKey;
            gdlo.ShowValue = this.ShowValue;
            gdlo.ShowCategoryName = this.ShowCategoryName;
            gdlo.ShowSeriesName = this.ShowSeriesName;
            gdlo.ShowPercentage = this.ShowPercentage;
            gdlo.ShowBubbleSize = this.ShowBubbleSize;
            gdlo.Separator = this.Separator;
            gdlo.ShowLeaderLines = this.ShowLeaderLines;

            return gdlo;
        }
        internal SLGroupDataLabelOptions Clone()
        {
            SLGroupDataLabelOptions gdlo = new SLGroupDataLabelOptions(this.ShapeProperties.listThemeColors, this.ShapeProperties.ThrowExceptionsIfAny);

            gdlo.Rotation           = this.Rotation;
            gdlo.Vertical           = this.Vertical;
            gdlo.Anchor             = this.Anchor;
            gdlo.AnchorCenter       = this.AnchorCenter;
            gdlo.HasNumberingFormat = this.HasNumberingFormat;
            gdlo.sFormatCode        = this.sFormatCode;
            gdlo.bSourceLinked      = this.bSourceLinked;
            gdlo.vLabelPosition     = this.vLabelPosition;
            gdlo.ShapeProperties    = this.ShapeProperties.Clone();
            gdlo.ShowLegendKey      = this.ShowLegendKey;
            gdlo.ShowValue          = this.ShowValue;
            gdlo.ShowCategoryName   = this.ShowCategoryName;
            gdlo.ShowSeriesName     = this.ShowSeriesName;
            gdlo.ShowPercentage     = this.ShowPercentage;
            gdlo.ShowBubbleSize     = this.ShowBubbleSize;
            gdlo.Separator          = this.Separator;
            gdlo.ShowLeaderLines    = this.ShowLeaderLines;

            return(gdlo);
        }
        internal C.ScatterChartSeries ToScatterChartSeries(bool IsStylish = false)
        {
            C.ScatterChartSeries scs = new C.ScatterChartSeries();
            scs.Index = new C.Index() { Val = this.Index };
            scs.Order = new C.Order() { Val = this.Order };

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

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

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

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

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

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

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

            return scs;
        }
        internal C.PieChartSeries ToPieChartSeries(bool IsStylish = false)
        {
            C.PieChartSeries pcs = new C.PieChartSeries();
            pcs.Index = new C.Index() { Val = this.Index };
            pcs.Order = new C.Order() { Val = this.Order };

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

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

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

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

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

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

            return pcs;
        }
        internal C.BubbleChartSeries ToBubbleChartSeries(bool IsStylish = false)
        {
            C.BubbleChartSeries bcs = new C.BubbleChartSeries();
            bcs.Index = new C.Index() { Val = this.Index };
            bcs.Order = new C.Order() { Val = this.Order };

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

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

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

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

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

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

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

            return bcs;
        }
Example #6
0
        internal C.PieChartSeries ToPieChartSeries(bool IsStylish)
        {
            C.PieChartSeries pcs = new C.PieChartSeries();
            pcs.Index = new C.Index()
            {
                Val = this.Index
            };
            pcs.Order = new C.Order()
            {
                Val = this.Order
            };

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

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

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

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

            if (this.GroupDataLabelOptions != null || this.DataLabelOptionsList.Count > 0)
            {
                if (this.GroupDataLabelOptions == null)
                {
                    SLGroupDataLabelOptions gdloptions = new SLGroupDataLabelOptions(this.Options.ShapeProperties.listThemeColors, this.Options.ShapeProperties.ThrowExceptionsIfAny);
                    pcs.Append(gdloptions.ToDataLabels(this.DataLabelOptionsList, true));
                }
                else
                {
                    pcs.Append(this.GroupDataLabelOptions.ToDataLabels(this.DataLabelOptionsList, false));
                }
            }

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

            return(pcs);
        }
Example #7
0
        internal C.BubbleChartSeries ToBubbleChartSeries(bool IsStylish)
        {
            C.BubbleChartSeries bcs = new C.BubbleChartSeries();
            bcs.Index = new C.Index()
            {
                Val = this.Index
            };
            bcs.Order = new C.Order()
            {
                Val = this.Order
            };

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

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

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

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

            if (this.GroupDataLabelOptions != null || this.DataLabelOptionsList.Count > 0)
            {
                if (this.GroupDataLabelOptions == null)
                {
                    SLGroupDataLabelOptions gdloptions = new SLGroupDataLabelOptions(this.Options.ShapeProperties.listThemeColors, this.Options.ShapeProperties.ThrowExceptionsIfAny);
                    bcs.Append(gdloptions.ToDataLabels(this.DataLabelOptionsList, true));
                }
                else
                {
                    bcs.Append(this.GroupDataLabelOptions.ToDataLabels(this.DataLabelOptionsList, false));
                }
            }

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

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

            return(bcs);
        }
Example #8
0
        internal C.ScatterChartSeries ToScatterChartSeries(bool IsStylish)
        {
            C.ScatterChartSeries scs = new C.ScatterChartSeries();
            scs.Index = new C.Index()
            {
                Val = this.Index
            };
            scs.Order = new C.Order()
            {
                Val = this.Order
            };

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

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

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

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

            if (this.GroupDataLabelOptions != null || this.DataLabelOptionsList.Count > 0)
            {
                if (this.GroupDataLabelOptions == null)
                {
                    SLGroupDataLabelOptions gdloptions = new SLGroupDataLabelOptions(this.Options.ShapeProperties.listThemeColors, this.Options.ShapeProperties.ThrowExceptionsIfAny);
                    scs.Append(gdloptions.ToDataLabels(this.DataLabelOptionsList, true));
                }
                else
                {
                    scs.Append(this.GroupDataLabelOptions.ToDataLabels(this.DataLabelOptionsList, false));
                }
            }

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

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

            return(scs);
        }
Example #9
0
 /// <summary>
 /// Set data label options to all data series.
 /// </summary>
 /// <param name="Options">Data label customization options.</param>
 public void SetGroupDataLabelOptions(SLGroupDataLabelOptions Options)
 {
     foreach (SLDataSeries ser in this.PlotArea.DataSeries)
     {
         ser.GroupDataLabelOptions = Options.Clone();
     }
 }
Example #10
0
        /// <summary>
        /// Set data label options to 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="Options">Data label customization options.</param>
        public void SetGroupDataLabelOptions(int DataSeriesIndex, SLGroupDataLabelOptions 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;

            this.PlotArea.DataSeries[DataSeriesIndex].GroupDataLabelOptions = Options.Clone();
        }
Example #11
0
        internal C.LineChartSeries ToLineChartSeries(bool IsStylish = false)
        {
            C.LineChartSeries lcs = new C.LineChartSeries();
            lcs.Index = new C.Index()
            {
                Val = this.Index
            };
            lcs.Order = new C.Order()
            {
                Val = this.Order
            };

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

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

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

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

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

            lcs.Append(this.AxisData.ToCategoryAxisData());
            lcs.Append(this.NumberData.ToValues());

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

            return(lcs);
        }
Example #12
0
        internal C.BarChartSeries ToBarChartSeries(bool IsStylish = false)
        {
            C.BarChartSeries bcs = new C.BarChartSeries();
            bcs.Index = new C.Index()
            {
                Val = this.Index
            };
            bcs.Order = new C.Order()
            {
                Val = this.Order
            };

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

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

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

            //PictureOptions

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

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

            bcs.Append(this.AxisData.ToCategoryAxisData());
            bcs.Append(this.NumberData.ToValues());

            if (this.Options.vShape != null)
            {
                bcs.Append(new C.Shape()
                {
                    Val = this.Options.vShape.Value
                });
            }

            return(bcs);
        }
Example #13
0
        internal C.PlotArea ToPlotArea()
        {
            C.PlotArea pa = new C.PlotArea();
            pa.Append(this.Layout.ToLayout());

            int iChartType;
            int i;

            // TODO: the rendering order is sort of listed in the following.
            // But apparently if you plot data series for doughnut first before bar-of-pie
            // it's different than if you plot bar-of-pie then doughnut.
            // Find out the "correct" order next version I suppose...

            // Excel 2010 apparently sets this by default for any chart...
            SLGroupDataLabelOptions gdlo = new SLGroupDataLabelOptions(this.ShapeProperties.listThemeColors);
            gdlo.ShowLegendKey = false;
            gdlo.ShowValue = false;
            gdlo.ShowCategoryName = false;
            gdlo.ShowSeriesName = false;
            gdlo.ShowPercentage = false;
            gdlo.ShowBubbleSize = false;

            #region Doughnut
            iChartType = (int)SLDataSeriesChartType.DoughnutChart;
            if (this.UsedChartTypes[iChartType])
            {
                C.DoughnutChart dc = new C.DoughnutChart();
                dc.VaryColors = new C.VaryColors() { Val = this.UsedChartOptions[iChartType].VaryColors ?? true };

                for (i = 0; i < this.DataSeries.Count; ++i)
                {
                    if ((int)this.DataSeries[i].ChartType == iChartType)
                    {
                        dc.Append(this.DataSeries[i].ToPieChartSeries());
                    }
                }

                dc.Append(gdlo.ToDataLabels(new Dictionary<int, SLDataLabelOptions>(), false));

                dc.Append(new C.FirstSliceAngle() { Val = this.UsedChartOptions[iChartType].FirstSliceAngle });
                dc.Append(new C.HoleSize() { Val = this.UsedChartOptions[iChartType].HoleSize });
                
                pa.Append(dc);
            }
            #endregion

            #region Bar-of-pie
            iChartType = (int)SLDataSeriesChartType.OfPieChartBar;
            if (this.UsedChartTypes[iChartType])
            {
                C.OfPieChart opc = new C.OfPieChart();
                opc.OfPieType = new C.OfPieType() { Val = C.OfPieValues.Bar };
                opc.VaryColors = new C.VaryColors() { Val = this.UsedChartOptions[iChartType].VaryColors ?? true };

                for (i = 0; i < this.DataSeries.Count; ++i)
                {
                    if ((int)this.DataSeries[i].ChartType == iChartType)
                    {
                        opc.Append(this.DataSeries[i].ToPieChartSeries());
                    }
                }

                opc.Append(gdlo.ToDataLabels(new Dictionary<int, SLDataLabelOptions>(), false));

                opc.Append(new C.GapWidth() { Val = this.UsedChartOptions[iChartType].GapWidth });
                
                if (this.UsedChartOptions[iChartType].HasSplit)
                {
                    opc.Append(new C.SplitType() { Val = this.UsedChartOptions[iChartType].SplitType });
                    if (this.UsedChartOptions[iChartType].SplitType != C.SplitValues.Custom)
                    {
                        opc.Append(new C.SplitPosition() { Val = this.UsedChartOptions[iChartType].SplitPosition });
                    }
                    else
                    {
                        C.CustomSplit custsplit = new C.CustomSplit();
                        foreach (int iPiePoint in this.UsedChartOptions[iChartType].SecondPiePoints)
                        {
                            custsplit.Append(new C.SecondPiePoint() { Val = (uint)iPiePoint });
                        }
                        opc.Append(custsplit);
                    }
                }

                opc.Append(new C.SecondPieSize() { Val = this.UsedChartOptions[iChartType].SecondPieSize });

                if (this.UsedChartOptions[iChartType].SeriesLinesShapeProperties.HasShapeProperties)
                {
                    opc.Append(new C.SeriesLines()
                    {
                        ChartShapeProperties = this.UsedChartOptions[iChartType].SeriesLinesShapeProperties.ToChartShapeProperties()
                    });
                }
                else
                {
                    opc.Append(new C.SeriesLines());
                }

                pa.Append(opc);
            }
            #endregion

            #region Pie-of-pie
            iChartType = (int)SLDataSeriesChartType.OfPieChartPie;
            if (this.UsedChartTypes[iChartType])
            {
                C.OfPieChart opc = new C.OfPieChart();
                opc.OfPieType = new C.OfPieType() { Val = C.OfPieValues.Pie };
                opc.VaryColors = new C.VaryColors() { Val = this.UsedChartOptions[iChartType].VaryColors ?? true };

                for (i = 0; i < this.DataSeries.Count; ++i)
                {
                    if ((int)this.DataSeries[i].ChartType == iChartType)
                    {
                        opc.Append(this.DataSeries[i].ToPieChartSeries());
                    }
                }

                opc.Append(gdlo.ToDataLabels(new Dictionary<int, SLDataLabelOptions>(), false));

                opc.Append(new C.GapWidth() { Val = this.UsedChartOptions[iChartType].GapWidth });

                if (this.UsedChartOptions[iChartType].HasSplit)
                {
                    opc.Append(new C.SplitType() { Val = this.UsedChartOptions[iChartType].SplitType });
                    if (this.UsedChartOptions[iChartType].SplitType != C.SplitValues.Custom)
                    {
                        opc.Append(new C.SplitPosition() { Val = this.UsedChartOptions[iChartType].SplitPosition });
                    }
                    else
                    {
                        C.CustomSplit custsplit = new C.CustomSplit();
                        foreach (int iPiePoint in this.UsedChartOptions[iChartType].SecondPiePoints)
                        {
                            custsplit.Append(new C.SecondPiePoint() { Val = (uint)iPiePoint });
                        }
                        opc.Append(custsplit);
                    }
                }

                opc.Append(new C.SecondPieSize() { Val = this.UsedChartOptions[iChartType].SecondPieSize });

                if (this.UsedChartOptions[iChartType].SeriesLinesShapeProperties.HasShapeProperties)
                {
                    opc.Append(new C.SeriesLines()
                    {
                        ChartShapeProperties = this.UsedChartOptions[iChartType].SeriesLinesShapeProperties.ToChartShapeProperties()
                    });
                }
                else
                {
                    opc.Append(new C.SeriesLines());
                }

                pa.Append(opc);
            }
            #endregion

            #region Pie
            iChartType = (int)SLDataSeriesChartType.PieChart;
            if (this.UsedChartTypes[iChartType])
            {
                C.PieChart pc = new C.PieChart();
                pc.VaryColors = new C.VaryColors() { Val = this.UsedChartOptions[iChartType].VaryColors ?? true };

                for (i = 0; i < this.DataSeries.Count; ++i)
                {
                    if ((int)this.DataSeries[i].ChartType == iChartType)
                    {
                        pc.Append(this.DataSeries[i].ToPieChartSeries());
                    }
                }

                pc.Append(gdlo.ToDataLabels(new Dictionary<int, SLDataLabelOptions>(), false));

                pc.Append(new C.FirstSliceAngle() { Val = this.UsedChartOptions[iChartType].FirstSliceAngle });

                pa.Append(pc);
            }
            #endregion

            #region Radar primary
            iChartType = (int)SLDataSeriesChartType.RadarChartPrimary;
            if (this.UsedChartTypes[iChartType])
            {
                C.RadarChart rc = new C.RadarChart();
                rc.RadarStyle = new C.RadarStyle() { Val = this.UsedChartOptions[iChartType].RadarStyle };
                rc.VaryColors = new C.VaryColors() { Val = false };

                for (i = 0; i < this.DataSeries.Count; ++i)
                {
                    if ((int)this.DataSeries[i].ChartType == iChartType)
                    {
                        rc.Append(this.DataSeries[i].ToRadarChartSeries());
                    }
                }

                rc.Append(gdlo.ToDataLabels(new Dictionary<int, SLDataLabelOptions>(), false));

                rc.Append(new C.AxisId() { Val = SLConstants.PrimaryAxis1 });
                rc.Append(new C.AxisId() { Val = SLConstants.PrimaryAxis2 });

                pa.Append(rc);
            }
            #endregion

            #region Radar secondary
            iChartType = (int)SLDataSeriesChartType.RadarChartSecondary;
            if (this.UsedChartTypes[iChartType])
            {
                C.RadarChart rc = new C.RadarChart();
                rc.RadarStyle = new C.RadarStyle() { Val = this.UsedChartOptions[iChartType].RadarStyle };
                rc.VaryColors = new C.VaryColors() { Val = false };

                for (i = 0; i < this.DataSeries.Count; ++i)
                {
                    if ((int)this.DataSeries[i].ChartType == iChartType)
                    {
                        rc.Append(this.DataSeries[i].ToRadarChartSeries());
                    }
                }

                rc.Append(gdlo.ToDataLabels(new Dictionary<int, SLDataLabelOptions>(), false));

                rc.Append(new C.AxisId() { Val = SLConstants.SecondaryAxis1 });
                rc.Append(new C.AxisId() { Val = SLConstants.SecondaryAxis2 });

                pa.Append(rc);
            }
            #endregion

            #region Area primary
            iChartType = (int)SLDataSeriesChartType.AreaChartPrimary;
            if (this.UsedChartTypes[iChartType])
            {
                C.AreaChart ac = new C.AreaChart();
                ac.Grouping = new C.Grouping() { Val = this.UsedChartOptions[iChartType].Grouping };
                ac.VaryColors = new C.VaryColors() { Val = false };

                for (i = 0; i < this.DataSeries.Count; ++i)
                {
                    if ((int)this.DataSeries[i].ChartType == iChartType)
                    {
                        ac.Append(this.DataSeries[i].ToAreaChartSeries());
                    }
                }

                ac.Append(gdlo.ToDataLabels(new Dictionary<int, SLDataLabelOptions>(), false));

                ac.Append(new C.AxisId() { Val = SLConstants.PrimaryAxis1 });
                ac.Append(new C.AxisId() { Val = SLConstants.PrimaryAxis2 });

                pa.Append(ac);
            }
            #endregion

            #region Area secondary
            iChartType = (int)SLDataSeriesChartType.AreaChartSecondary;
            if (this.UsedChartTypes[iChartType])
            {
                C.AreaChart ac = new C.AreaChart();
                ac.Grouping = new C.Grouping() { Val = this.UsedChartOptions[iChartType].Grouping };
                ac.VaryColors = new C.VaryColors() { Val = false };

                for (i = 0; i < this.DataSeries.Count; ++i)
                {
                    if ((int)this.DataSeries[i].ChartType == iChartType)
                    {
                        ac.Append(this.DataSeries[i].ToAreaChartSeries());
                    }
                }

                ac.Append(gdlo.ToDataLabels(new Dictionary<int, SLDataLabelOptions>(), false));

                ac.Append(new C.AxisId() { Val = SLConstants.SecondaryAxis1 });
                ac.Append(new C.AxisId() { Val = SLConstants.SecondaryAxis2 });

                pa.Append(ac);
            }
            #endregion

            #region Column primary
            iChartType = (int)SLDataSeriesChartType.BarChartColumnPrimary;
            if (this.UsedChartTypes[iChartType])
            {
                C.BarChart bc = new C.BarChart();
                bc.BarDirection = new C.BarDirection() { Val = C.BarDirectionValues.Column };
                bc.BarGrouping = new C.BarGrouping() { Val = this.UsedChartOptions[iChartType].BarGrouping };
                bc.VaryColors = new C.VaryColors() { Val = false };

                for (i = 0; i < this.DataSeries.Count; ++i)
                {
                    if ((int)this.DataSeries[i].ChartType == iChartType)
                    {
                        bc.Append(this.DataSeries[i].ToBarChartSeries());
                    }
                }

                bc.Append(gdlo.ToDataLabels(new Dictionary<int, SLDataLabelOptions>(), false));

                bc.Append(new C.GapWidth() { Val = this.UsedChartOptions[iChartType].GapWidth });

                if (this.UsedChartOptions[iChartType].Overlap != 0)
                {
                    bc.Append(new C.Overlap() { Val = this.UsedChartOptions[iChartType].Overlap });
                }

                bc.Append(new C.AxisId() { Val = SLConstants.PrimaryAxis1 });
                bc.Append(new C.AxisId() { Val = SLConstants.PrimaryAxis2 });

                pa.Append(bc);
            }
            #endregion

            #region Column secondary
            iChartType = (int)SLDataSeriesChartType.BarChartColumnSecondary;
            if (this.UsedChartTypes[iChartType])
            {
                C.BarChart bc = new C.BarChart();
                bc.BarDirection = new C.BarDirection() { Val = C.BarDirectionValues.Column };
                bc.BarGrouping = new C.BarGrouping() { Val = this.UsedChartOptions[iChartType].BarGrouping };
                bc.VaryColors = new C.VaryColors() { Val = false };

                for (i = 0; i < this.DataSeries.Count; ++i)
                {
                    if ((int)this.DataSeries[i].ChartType == iChartType)
                    {
                        bc.Append(this.DataSeries[i].ToBarChartSeries());
                    }
                }

                bc.Append(gdlo.ToDataLabels(new Dictionary<int, SLDataLabelOptions>(), false));

                bc.Append(new C.GapWidth() { Val = this.UsedChartOptions[iChartType].GapWidth });

                if (this.UsedChartOptions[iChartType].Overlap != 0)
                {
                    bc.Append(new C.Overlap() { Val = this.UsedChartOptions[iChartType].Overlap });
                }

                bc.Append(new C.AxisId() { Val = SLConstants.SecondaryAxis1 });
                bc.Append(new C.AxisId() { Val = SLConstants.SecondaryAxis2 });

                pa.Append(bc);
            }
            #endregion

            #region Bar primary
            iChartType = (int)SLDataSeriesChartType.BarChartBarPrimary;
            if (this.UsedChartTypes[iChartType])
            {
                C.BarChart bc = new C.BarChart();
                bc.BarDirection = new C.BarDirection() { Val = C.BarDirectionValues.Bar };
                bc.BarGrouping = new C.BarGrouping() { Val = this.UsedChartOptions[iChartType].BarGrouping };
                bc.VaryColors = new C.VaryColors() { Val = false };

                for (i = 0; i < this.DataSeries.Count; ++i)
                {
                    if ((int)this.DataSeries[i].ChartType == iChartType)
                    {
                        bc.Append(this.DataSeries[i].ToBarChartSeries());
                    }
                }

                bc.Append(gdlo.ToDataLabels(new Dictionary<int, SLDataLabelOptions>(), false));

                bc.Append(new C.GapWidth() { Val = this.UsedChartOptions[iChartType].GapWidth });

                if (this.UsedChartOptions[iChartType].Overlap != 0)
                {
                    bc.Append(new C.Overlap() { Val = this.UsedChartOptions[iChartType].Overlap });
                }

                bc.Append(new C.AxisId() { Val = SLConstants.PrimaryAxis1 });
                bc.Append(new C.AxisId() { Val = SLConstants.PrimaryAxis2 });

                pa.Append(bc);
            }
            #endregion

            #region Bar secondary
            iChartType = (int)SLDataSeriesChartType.BarChartBarSecondary;
            if (this.UsedChartTypes[iChartType])
            {
                C.BarChart bc = new C.BarChart();
                bc.BarDirection = new C.BarDirection() { Val = C.BarDirectionValues.Bar };
                bc.BarGrouping = new C.BarGrouping() { Val = this.UsedChartOptions[iChartType].BarGrouping };
                bc.VaryColors = new C.VaryColors() { Val = false };

                for (i = 0; i < this.DataSeries.Count; ++i)
                {
                    if ((int)this.DataSeries[i].ChartType == iChartType)
                    {
                        bc.Append(this.DataSeries[i].ToBarChartSeries());
                    }
                }

                bc.Append(gdlo.ToDataLabels(new Dictionary<int, SLDataLabelOptions>(), false));

                bc.Append(new C.GapWidth() { Val = this.UsedChartOptions[iChartType].GapWidth });

                if (this.UsedChartOptions[iChartType].Overlap != 0)
                {
                    bc.Append(new C.Overlap() { Val = this.UsedChartOptions[iChartType].Overlap });
                }

                bc.Append(new C.AxisId() { Val = SLConstants.SecondaryAxis1 });
                bc.Append(new C.AxisId() { Val = SLConstants.SecondaryAxis2 });

                pa.Append(bc);
            }
            #endregion

            #region Scatter primary
            iChartType = (int)SLDataSeriesChartType.ScatterChartPrimary;
            if (this.UsedChartTypes[iChartType])
            {
                C.ScatterChart sc = new C.ScatterChart();
                sc.ScatterStyle = new C.ScatterStyle() { Val = this.UsedChartOptions[iChartType].ScatterStyle };
                sc.VaryColors = new C.VaryColors() { Val = false };

                for (i = 0; i < this.DataSeries.Count; ++i)
                {
                    if ((int)this.DataSeries[i].ChartType == iChartType)
                    {
                        sc.Append(this.DataSeries[i].ToScatterChartSeries());
                    }
                }

                sc.Append(gdlo.ToDataLabels(new Dictionary<int, SLDataLabelOptions>(), false));

                sc.Append(new C.AxisId() { Val = SLConstants.PrimaryAxis1 });
                sc.Append(new C.AxisId() { Val = SLConstants.PrimaryAxis2 });

                pa.Append(sc);
            }
            #endregion

            #region Scatter secondary
            iChartType = (int)SLDataSeriesChartType.ScatterChartSecondary;
            if (this.UsedChartTypes[iChartType])
            {
                C.ScatterChart sc = new C.ScatterChart();
                sc.ScatterStyle = new C.ScatterStyle() { Val = this.UsedChartOptions[iChartType].ScatterStyle };
                sc.VaryColors = new C.VaryColors() { Val = false };

                for (i = 0; i < this.DataSeries.Count; ++i)
                {
                    if ((int)this.DataSeries[i].ChartType == iChartType)
                    {
                        sc.Append(this.DataSeries[i].ToScatterChartSeries());
                    }
                }

                sc.Append(gdlo.ToDataLabels(new Dictionary<int, SLDataLabelOptions>(), false));

                sc.Append(new C.AxisId() { Val = SLConstants.SecondaryAxis1 });
                sc.Append(new C.AxisId() { Val = SLConstants.SecondaryAxis2 });

                pa.Append(sc);
            }
            #endregion

            #region Line primary
            iChartType = (int)SLDataSeriesChartType.LineChartPrimary;
            if (this.UsedChartTypes[iChartType])
            {
                C.LineChart lc = new C.LineChart();
                lc.Grouping = new C.Grouping() { Val = this.UsedChartOptions[iChartType].Grouping };
                lc.VaryColors = new C.VaryColors() { Val = false };

                for (i = 0; i < this.DataSeries.Count; ++i)
                {
                    if ((int)this.DataSeries[i].ChartType == iChartType)
                    {
                        lc.Append(this.DataSeries[i].ToLineChartSeries());
                    }
                }

                lc.Append(gdlo.ToDataLabels(new Dictionary<int, SLDataLabelOptions>(), false));

                lc.Append(new C.ShowMarker() { Val = this.UsedChartOptions[iChartType].ShowMarker });
                lc.Append(new C.Smooth() { Val = this.UsedChartOptions[iChartType].Smooth });

                lc.Append(new C.AxisId() { Val = SLConstants.PrimaryAxis1 });
                lc.Append(new C.AxisId() { Val = SLConstants.PrimaryAxis2 });

                pa.Append(lc);
            }
            #endregion

            #region Line secondary
            iChartType = (int)SLDataSeriesChartType.LineChartSecondary;
            if (this.UsedChartTypes[iChartType])
            {
                C.LineChart lc = new C.LineChart();
                lc.Grouping = new C.Grouping() { Val = this.UsedChartOptions[iChartType].Grouping };
                lc.VaryColors = new C.VaryColors() { Val = false };

                for (i = 0; i < this.DataSeries.Count; ++i)
                {
                    if ((int)this.DataSeries[i].ChartType == iChartType)
                    {
                        lc.Append(this.DataSeries[i].ToLineChartSeries());
                    }
                }

                lc.Append(gdlo.ToDataLabels(new Dictionary<int, SLDataLabelOptions>(), false));

                lc.Append(new C.ShowMarker() { Val = this.UsedChartOptions[iChartType].ShowMarker });
                lc.Append(new C.Smooth() { Val = this.UsedChartOptions[iChartType].Smooth });

                lc.Append(new C.AxisId() { Val = SLConstants.SecondaryAxis1 });
                lc.Append(new C.AxisId() { Val = SLConstants.SecondaryAxis2 });

                pa.Append(lc);
            }
            #endregion

            #region Area3D
            iChartType = (int)SLDataSeriesChartType.Area3DChart;
            if (this.UsedChartTypes[iChartType])
            {
                C.Area3DChart ac = new C.Area3DChart();
                ac.Grouping = new C.Grouping() { Val = this.UsedChartOptions[iChartType].Grouping };
                ac.VaryColors = new C.VaryColors() { Val = false };

                for (i = 0; i < this.DataSeries.Count; ++i)
                {
                    if ((int)this.DataSeries[i].ChartType == iChartType)
                    {
                        ac.Append(this.DataSeries[i].ToAreaChartSeries());
                    }
                }

                ac.Append(gdlo.ToDataLabels(new Dictionary<int, SLDataLabelOptions>(), false));

                if (this.UsedChartOptions[iChartType].GapDepth != 150)
                {
                    ac.Append(new C.GapDepth() { Val = this.UsedChartOptions[iChartType].GapDepth });
                }

                ac.Append(new C.AxisId() { Val = SLConstants.PrimaryAxis1 });
                ac.Append(new C.AxisId() { Val = SLConstants.PrimaryAxis2 });
                ac.Append(new C.AxisId() { Val = SLConstants.PrimaryAxis3 });

                pa.Append(ac);
            }
            #endregion

            #region Bar3D
            iChartType = (int)SLDataSeriesChartType.Bar3DChart;
            if (this.UsedChartTypes[iChartType])
            {
                C.Bar3DChart bc = new C.Bar3DChart();
                bc.BarDirection = new C.BarDirection() { Val = this.UsedChartOptions[iChartType].BarDirection };
                bc.BarGrouping = new C.BarGrouping() { Val = this.UsedChartOptions[iChartType].BarGrouping };
                bc.VaryColors = new C.VaryColors() { Val = false };

                for (i = 0; i < this.DataSeries.Count; ++i)
                {
                    if ((int)this.DataSeries[i].ChartType == iChartType)
                    {
                        bc.Append(this.DataSeries[i].ToBarChartSeries());
                    }
                }

                bc.Append(gdlo.ToDataLabels(new Dictionary<int, SLDataLabelOptions>(), false));

                bc.Append(new C.GapWidth() { Val = this.UsedChartOptions[iChartType].GapWidth });

                if (this.UsedChartOptions[iChartType].GapDepth != 150)
                {
                    bc.Append(new C.GapDepth() { Val = this.UsedChartOptions[iChartType].GapDepth });
                }

                bc.Append(new C.Shape() { Val = this.UsedChartOptions[iChartType].Shape });

                bc.Append(new C.AxisId() { Val = SLConstants.PrimaryAxis1 });
                bc.Append(new C.AxisId() { Val = SLConstants.PrimaryAxis2 });
                bc.Append(new C.AxisId() { Val = SLConstants.PrimaryAxis3 });

                pa.Append(bc);
            }
            #endregion

            #region Bubble
            iChartType = (int)SLDataSeriesChartType.BubbleChart;
            if (this.UsedChartTypes[iChartType])
            {
                C.BubbleChart bc = new C.BubbleChart();
                bc.VaryColors = new C.VaryColors() { Val = false };

                for (i = 0; i < this.DataSeries.Count; ++i)
                {
                    if ((int)this.DataSeries[i].ChartType == iChartType)
                    {
                        bc.Append(this.DataSeries[i].ToBubbleChartSeries());
                    }
                }

                bc.Append(gdlo.ToDataLabels(new Dictionary<int, SLDataLabelOptions>(), false));

                if (!this.UsedChartOptions[iChartType].Bubble3D)
                {
                    bc.Append(new C.Bubble3D() { Val = this.UsedChartOptions[iChartType].Bubble3D });
                }

                if (this.UsedChartOptions[iChartType].BubbleScale != 100)
                {
                    bc.Append(new C.BubbleScale() { Val = this.UsedChartOptions[iChartType].BubbleScale });
                }

                if (!this.UsedChartOptions[iChartType].ShowNegativeBubbles)
                {
                    bc.Append(new C.ShowNegativeBubbles() { Val = this.UsedChartOptions[iChartType].ShowNegativeBubbles });
                }

                if (this.UsedChartOptions[iChartType].SizeRepresents != C.SizeRepresentsValues.Area)
                {
                    bc.Append(new C.SizeRepresents() { Val = this.UsedChartOptions[iChartType].SizeRepresents });
                }

                bc.Append(new C.AxisId() { Val = SLConstants.PrimaryAxis1 });
                bc.Append(new C.AxisId() { Val = SLConstants.PrimaryAxis2 });

                pa.Append(bc);
            }
            #endregion

            #region Line3D
            iChartType = (int)SLDataSeriesChartType.Line3DChart;
            if (this.UsedChartTypes[iChartType])
            {
                C.Line3DChart lc = new C.Line3DChart();
                lc.Grouping = new C.Grouping() { Val = this.UsedChartOptions[iChartType].Grouping };
                lc.VaryColors = new C.VaryColors() { Val = false };

                for (i = 0; i < this.DataSeries.Count; ++i)
                {
                    if ((int)this.DataSeries[i].ChartType == iChartType)
                    {
                        lc.Append(this.DataSeries[i].ToLineChartSeries());
                    }
                }

                lc.Append(gdlo.ToDataLabels(new Dictionary<int, SLDataLabelOptions>(), false));

                if (this.UsedChartOptions[iChartType].GapDepth != 150)
                {
                    lc.Append(new C.GapDepth() { Val = this.UsedChartOptions[iChartType].GapDepth });
                }

                lc.Append(new C.AxisId() { Val = SLConstants.PrimaryAxis1 });
                lc.Append(new C.AxisId() { Val = SLConstants.PrimaryAxis2 });
                lc.Append(new C.AxisId() { Val = SLConstants.PrimaryAxis3 });

                pa.Append(lc);
            }
            #endregion

            #region Pie3D
            iChartType = (int)SLDataSeriesChartType.Pie3DChart;
            if (this.UsedChartTypes[iChartType])
            {
                C.Pie3DChart pc = new C.Pie3DChart();
                pc.VaryColors = new C.VaryColors() { Val = this.UsedChartOptions[iChartType].VaryColors ?? true };

                for (i = 0; i < this.DataSeries.Count; ++i)
                {
                    if ((int)this.DataSeries[i].ChartType == iChartType)
                    {
                        pc.Append(this.DataSeries[i].ToPieChartSeries());
                    }
                }

                pc.Append(gdlo.ToDataLabels(new Dictionary<int, SLDataLabelOptions>(), false));

                pa.Append(pc);
            }
            #endregion

            #region Surface
            iChartType = (int)SLDataSeriesChartType.SurfaceChart;
            if (this.UsedChartTypes[iChartType])
            {
                C.SurfaceChart sc = new C.SurfaceChart();
                if (this.UsedChartOptions[iChartType].bWireframe != null)
                {
                    sc.Wireframe = new C.Wireframe() { Val = this.UsedChartOptions[iChartType].Wireframe };
                }

                for (i = 0; i < this.DataSeries.Count; ++i)
                {
                    if ((int)this.DataSeries[i].ChartType == iChartType)
                    {
                        sc.Append(this.DataSeries[i].ToSurfaceChartSeries());
                    }
                }

                sc.Append(new C.AxisId() { Val = SLConstants.PrimaryAxis1 });
                sc.Append(new C.AxisId() { Val = SLConstants.PrimaryAxis2 });
                sc.Append(new C.AxisId() { Val = SLConstants.PrimaryAxis3 });

                pa.Append(sc);
            }
            #endregion

            #region Surface3D
            iChartType = (int)SLDataSeriesChartType.Surface3DChart;
            if (this.UsedChartTypes[iChartType])
            {
                C.Surface3DChart sc = new C.Surface3DChart();
                if (this.UsedChartOptions[iChartType].bWireframe != null)
                {
                    sc.Wireframe = new C.Wireframe() { Val = this.UsedChartOptions[iChartType].Wireframe };
                }

                for (i = 0; i < this.DataSeries.Count; ++i)
                {
                    if ((int)this.DataSeries[i].ChartType == iChartType)
                    {
                        sc.Append(this.DataSeries[i].ToSurfaceChartSeries());
                    }
                }

                sc.Append(new C.AxisId() { Val = SLConstants.PrimaryAxis1 });
                sc.Append(new C.AxisId() { Val = SLConstants.PrimaryAxis2 });
                sc.Append(new C.AxisId() { Val = SLConstants.PrimaryAxis3 });

                pa.Append(sc);
            }
            #endregion

            if (this.HasPrimaryAxes)
            {
                this.PrimaryTextAxis.IsCrosses = this.PrimaryValueAxis.OtherAxisIsCrosses;
                this.PrimaryTextAxis.Crosses = this.PrimaryValueAxis.OtherAxisCrosses;
                this.PrimaryTextAxis.CrossesAt = this.PrimaryValueAxis.OtherAxisCrossesAt;

                this.PrimaryTextAxis.OtherAxisIsInReverseOrder = this.PrimaryValueAxis.InReverseOrder;

                if (this.PrimaryValueAxis.OtherAxisIsCrosses != null
                    && this.PrimaryValueAxis.OtherAxisIsCrosses.Value
                    && this.PrimaryValueAxis.OtherAxisCrosses == C.CrossesValues.Maximum)
                {
                    this.PrimaryTextAxis.OtherAxisCrossedAtMaximum = true;
                }
                else
                {
                    this.PrimaryTextAxis.OtherAxisCrossedAtMaximum = false;
                }

                this.PrimaryValueAxis.IsCrosses = this.PrimaryTextAxis.OtherAxisIsCrosses;
                this.PrimaryValueAxis.Crosses = this.PrimaryTextAxis.OtherAxisCrosses;
                this.PrimaryValueAxis.CrossesAt = this.PrimaryTextAxis.OtherAxisCrossesAt;

                // value axis takes on text axis CrossBetween.
                this.PrimaryValueAxis.CrossBetween = this.PrimaryTextAxis.CrossBetween;

                this.PrimaryValueAxis.OtherAxisIsInReverseOrder = this.PrimaryTextAxis.InReverseOrder;

                if (this.PrimaryTextAxis.OtherAxisIsCrosses != null
                    && this.PrimaryTextAxis.OtherAxisIsCrosses.Value
                    && this.PrimaryTextAxis.OtherAxisCrosses == C.CrossesValues.Maximum)
                {
                    this.PrimaryValueAxis.OtherAxisCrossedAtMaximum = true;
                }
                else
                {
                    this.PrimaryValueAxis.OtherAxisCrossedAtMaximum = false;
                }

                switch (this.PrimaryTextAxis.AxisType)
                {
                    case SLAxisType.Category:
                        pa.Append(this.PrimaryTextAxis.ToCategoryAxis());
                        break;
                    case SLAxisType.Date:
                        pa.Append(this.PrimaryTextAxis.ToDateAxis());
                        break;
                    case SLAxisType.Value:
                        pa.Append(this.PrimaryTextAxis.ToValueAxis());
                        break;
                }
                pa.Append(this.PrimaryValueAxis.ToValueAxis());
            }

            if (this.HasDepthAxis)
            {
                pa.Append(this.DepthAxis.ToSeriesAxis());
            }

            if (this.HasSecondaryAxes)
            {
                this.SecondaryTextAxis.IsCrosses = this.SecondaryValueAxis.OtherAxisIsCrosses;
                this.SecondaryTextAxis.Crosses = this.SecondaryValueAxis.OtherAxisCrosses;
                this.SecondaryTextAxis.CrossesAt = this.SecondaryValueAxis.OtherAxisCrossesAt;

                this.SecondaryTextAxis.OtherAxisIsInReverseOrder = this.SecondaryValueAxis.InReverseOrder;

                if (this.SecondaryValueAxis.OtherAxisIsCrosses != null
                    && this.SecondaryValueAxis.OtherAxisIsCrosses.Value
                    && this.SecondaryValueAxis.OtherAxisCrosses == C.CrossesValues.Maximum)
                {
                    this.SecondaryTextAxis.OtherAxisCrossedAtMaximum = true;
                }
                else
                {
                    this.SecondaryTextAxis.OtherAxisCrossedAtMaximum = false;
                }

                this.SecondaryValueAxis.IsCrosses = this.SecondaryTextAxis.OtherAxisIsCrosses;
                this.SecondaryValueAxis.Crosses = this.SecondaryTextAxis.OtherAxisCrosses;
                this.SecondaryValueAxis.CrossesAt = this.SecondaryTextAxis.OtherAxisCrossesAt;

                // value axis takes on text axis CrossBetween.
                this.SecondaryValueAxis.CrossBetween = this.SecondaryTextAxis.CrossBetween;

                this.SecondaryValueAxis.OtherAxisIsInReverseOrder = this.SecondaryTextAxis.InReverseOrder;

                if (this.SecondaryTextAxis.OtherAxisIsCrosses != null
                    && this.SecondaryTextAxis.OtherAxisIsCrosses.Value
                    && this.SecondaryTextAxis.OtherAxisCrosses == C.CrossesValues.Maximum)
                {
                    this.SecondaryValueAxis.OtherAxisCrossedAtMaximum = true;
                }
                else
                {
                    this.SecondaryValueAxis.OtherAxisCrossedAtMaximum = false;
                }

                // the order of axes is:
                // 1) primary category/date/value axis
                // 2) primary value axis
                // 3) secondary value axis
                // 4) secondary category/date/value axis
                pa.Append(this.SecondaryValueAxis.ToValueAxis());
                switch (this.SecondaryTextAxis.AxisType)
                {
                    case SLAxisType.Category:
                        pa.Append(this.SecondaryTextAxis.ToCategoryAxis());
                        break;
                    case SLAxisType.Date:
                        pa.Append(this.SecondaryTextAxis.ToDateAxis());
                        break;
                    case SLAxisType.Value:
                        pa.Append(this.SecondaryTextAxis.ToValueAxis());
                        break;
                }
            }

            if (this.ShowDataTable) pa.Append(this.DataTable.ToDataTable());

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

            return pa;
        }
Example #14
0
        internal C.AreaChartSeries ToAreaChartSeries()
        {
            C.AreaChartSeries acs = new C.AreaChartSeries();
            acs.Index = new C.Index() { Val = this.Index };
            acs.Order = new C.Order() { Val = this.Order };

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

            if (this.Options.ShapeProperties.HasShapeProperties)
            {
                acs.ChartShapeProperties = this.Options.ShapeProperties.ToChartShapeProperties();
            }

            //PictureOptions

            if (this.DataPointOptionsList.Count > 0)
            {
                List<int> indexlist = this.DataPointOptionsList.Keys.ToList<int>();
                indexlist.Sort();
                int index;
                for (int i = 0; i < indexlist.Count; ++i)
                {
                    index = indexlist[i];
                    acs.Append(this.DataPointOptionsList[index].ToDataPoint(index));
                }
            }

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

            acs.Append(this.AxisData.ToCategoryAxisData());
            acs.Append(this.NumberData.ToValues());

            return acs;
        }