Exemplo n.º 1
0
 internal void ReadXml(XElement node, MemoryFolder mFolder, XFile xFile)
 {
     foreach (XElement element in node.Elements())
     {
         if (element.Name.LocalName == "ser")
         {
             ExcelLineSeries series = new ExcelLineSeries();
             series.ReadXml(element, mFolder, xFile);
             this.LineSeries.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 == "dropLines")
         {
             this.DropLine = new ExcelChartLines();
             this.DropLine.ReadXml(element, mFolder, xFile);
         }
         else if (element.Name.LocalName == "hiLowLines")
         {
             this.HighLowLine = new ExcelChartLines();
             this.HighLowLine.ReadXml(element, mFolder, xFile);
         }
         else if (element.Name.LocalName == "upDownBars")
         {
             ExcelUpDownBars bars = new ExcelUpDownBars();
             bars.ReadXml(element, mFolder, xFile);
             this.UpDownBars = bars;
         }
         else if (element.Name.LocalName == "axId")
         {
             int num = element.GetAttributeValueOrDefaultOfInt32Type("val", 0);
             if (!this.XAxisID.HasValue)
             {
                 this.XAxisID = new int?(num);
             }
             else if (!this.YAxisID.HasValue)
             {
                 this.YAxisID = new int?(num);
             }
         }
     }
     this.ChartType = (this.LineSeries.Count == 3) ? ExcelChartType.StockHighLowClose : ExcelChartType.StockOpenHighLowClose;
 }
Exemplo n.º 2
0
        internal void ReadXml(XElement node, MemoryFolder mFolder, XFile xFile)
        {
            string areaChart = "standard";
            bool   marker    = false;

            foreach (XElement element in node.Elements())
            {
                if (element.Name.LocalName == "grouping")
                {
                    areaChart = element.GetAttributeValueOrDefaultOfStringType("val", "standard");
                }
                else if (element.Name.LocalName == "varyColors")
                {
                    this.VaryColors = element.GetAttributeValueOrDefaultOfBooleanType("val", true);
                }
                else if (element.Name.LocalName == "ser")
                {
                    ExcelLineSeries series = new ExcelLineSeries();
                    series.ReadXml(element, mFolder, xFile);
                    this.LineSeries.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 == "dropLines")
                {
                    this.DropLine = new ExcelChartLines();
                    this.DropLine.ReadXml(element, mFolder, xFile);
                }
                else if (element.Name.LocalName == "hiLowLines")
                {
                    this.HighLowLine = new ExcelChartLines();
                    this.HighLowLine.ReadXml(element, mFolder, xFile);
                }
                else if (element.Name.LocalName == "upDownBars")
                {
                    ExcelUpDownBars bars = new ExcelUpDownBars();
                    bars.ReadXml(element, mFolder, xFile);
                    this.UpDownBars = bars;
                }
                else if (element.Name.LocalName == "marker")
                {
                    marker = element.GetAttributeValueOrDefaultOfBooleanType("val", true);
                }
                else if (element.Name.LocalName == "smooth")
                {
                    this.Smoothing = element.GetAttributeValueOrDefaultOfBooleanType("val", true);
                }
                else if (element.Name.LocalName == "axId")
                {
                    int num = element.GetAttributeValueOrDefaultOfInt32Type("val", 0);
                    if (!this.XAxisID.HasValue)
                    {
                        this.XAxisID = new int?(num);
                    }
                    else if (!this.YAxisID.HasValue)
                    {
                        this.YAxisID = new int?(num);
                    }
                }
            }
            this.ChartType = this.GetChartType(areaChart, marker);
        }