Esempio n. 1
0
        internal void ReadXml(XElement node, MemoryFolder mFolder, XFile xFile)
        {
            foreach (XElement element in node.Elements())
            {
                if (element.Name.LocalName == "varyColors")
                {
                    this.VaryColors = element.GetAttributeValueOrDefaultOfBooleanType("val", true);
                }
                else if (element.Name.LocalName == "ser")
                {
                    ExcelPieSeries series = new ExcelPieSeries();
                    series.ReadXml(element, mFolder, xFile);
                    this.PieSeries.Add(series);
                }
                else if (element.Name.LocalName == "dLbls")
                {
                    ExcelDataLabels labels = new ExcelDataLabels();
                    labels.ReadXml(element, mFolder, xFile);
                    this.DataLabels = labels;
                }
                else if (element.Name.LocalName == "firstSliceAng")
                {
                    this.FirstSliceAngle = element.GetAttributeValueOrDefaultOfInt32Type("val", 0);
                }
                else if (element.Name.LocalName == "holeSize")
                {
                    this.HoleSize = element.GetAttributeValueOrDefaultOfInt32Type("val", 10);
                }
            }
            bool flag = true;

            if (this.PieSeries.Count > 0)
            {
                int explosion = this.PieSeries[0].Explosion;
                foreach (IExcelPieSeries series2 in this.PieSeries)
                {
                    if ((series2.Explosion == 0) || (series2.Explosion != explosion))
                    {
                        flag = false;
                        break;
                    }
                }
            }
            this.ChartType = flag ? ExcelChartType.DoughuntExploded : ExcelChartType.Doughunt;
        }
Esempio n. 2
0
        internal void ReadXml(XElement node, MemoryFolder mFolder, XFile xFile)
        {
            foreach (XElement element in node.Elements())
            {
                if (element.Name.LocalName == "ofPieType")
                {
                    if (element.GetAttributeValueOrDefaultOfStringType("val", "pie") == "pie")
                    {
                        this.ChartType = ExcelChartType.PieOfPie;
                    }
                    else
                    {
                        this.ChartType = ExcelChartType.BarOfPie;
                    }
                }
                else if (element.Name.LocalName == "varyColors")
                {
                    this.VaryColors = element.GetAttributeValueOrDefaultOfBooleanType("val", true);
                }
                else if (element.Name.LocalName == "ser")
                {
                    ExcelPieSeries series = new ExcelPieSeries();
                    series.ReadXml(element, mFolder, xFile);
                    this.PieSeries.Add(series);
                }
                else if (element.Name.LocalName == "dLbls")
                {
                    ExcelDataLabels labels = new ExcelDataLabels();
                    labels.ReadXml(element, mFolder, xFile);
                    this.DataLabels = labels;
                }
                else if (element.Name.LocalName == "gapWidth")
                {
                    this.GapWidth = element.GetAttributeValueOrDefaultOfInt32Type("val", 150);
                }
                else if (element.Name.LocalName == "splitType")
                {
                    switch (element.GetAttributeValueOrDefaultOfStringType("val", "auto"))
                    {
                    case "auto":
                        this.SplitType = OfPieChartSplitType.Auto;
                        break;

                    case "cust":
                        this.SplitType = OfPieChartSplitType.Custom;
                        break;

                    case "percent":
                        this.SplitType = OfPieChartSplitType.Percent;
                        break;

                    case "pos":
                        this.SplitType = OfPieChartSplitType.Position;
                        break;

                    case "val":
                        this.SplitType = OfPieChartSplitType.Value;
                        break;
                    }
                }
                else if (element.Name.LocalName == "splitPos")
                {
                    this.SplitPosition = element.GetAttributeValueOrDefaultOfDoubleType("val", 0.0);
                }
                else if (element.Name.LocalName == "custSplit")
                {
                    foreach (XElement element2 in element.Elements())
                    {
                        this.CustomSplitPoints.Add(element2.GetAttributeValueOrDefaultOfInt32Type("val", 0));
                    }
                }
                else if (element.Name.LocalName == "secondPieSize")
                {
                    this.SecondPieSize = element.GetAttributeValueOrDefaultOfInt32Type("val", 0x4b);
                }
                else if (element.Name.LocalName == "serLines")
                {
                    this.SeriesLines = new ExcelChartLines();
                    this.SeriesLines.ReadXml(element, mFolder, xFile);
                }
            }
        }