Ejemplo n.º 1
0
        internal void ReadXml(XElement node, MemoryFolder mFolder, XFile xFile)
        {
            foreach (XElement element in node.Elements())
            {
                if (element.Name.LocalName == "legendPos")
                {
                    switch (element.GetAttributeValueOrDefaultOfStringType("val", "r"))
                    {
                    case "r":
                        this.Position = ExcelLegendPositon.Right;
                        break;

                    case "l":
                        this.Position = ExcelLegendPositon.Left;
                        break;

                    case "t":
                        this.Position = ExcelLegendPositon.Top;
                        break;

                    case "b":
                        this.Position = ExcelLegendPositon.Bottom;
                        break;

                    case "tr":
                        this.Position = ExcelLegendPositon.TopRight;
                        break;
                    }
                }
                else if (element.Name.LocalName == "legendEntry")
                {
                    ExcelLegendEntry entry = new ExcelLegendEntry();
                    entry.ReadXml(element, mFolder, xFile);
                    this.LegendEntries.Add(entry);
                }
                else if (element.Name.LocalName == "layout")
                {
                    Dt.Xls.Chart.Layout layout = new Dt.Xls.Chart.Layout();
                    layout.ReadXml(element, mFolder, xFile);
                    this.Layout = layout;
                }
                else if (element.Name.LocalName == "overlay")
                {
                    this.Overlay = element.GetAttributeValueOrDefaultOfBooleanType("val", true);
                }
                else if (element.Name.LocalName == "spPr")
                {
                    ExcelChartFormat format = new ExcelChartFormat();
                    format.ReadXml(element, mFolder, xFile);
                    this.ShapeFormat = format;
                }
                else if (element.Name.LocalName == "txPr")
                {
                    ExcelTextFormat format2 = new ExcelTextFormat();
                    format2.ReadXml(element, mFolder, xFile);
                    this.TextFormat = format2;
                }
            }
        }
Ejemplo n.º 2
0
 internal void ReadXml(XElement node, MemoryFolder mFolder, XFile xFile)
 {
     foreach (XElement element in node.Elements())
     {
         if (element.Name.LocalName == "overlay")
         {
             this.Overlay = element.GetAttributeValueOrDefaultOfBooleanType("val", true);
         }
         else if (element.Name.LocalName == "layout")
         {
             Dt.Xls.Chart.Layout layout = new Dt.Xls.Chart.Layout();
             layout.ReadXml(element, mFolder, xFile);
             this.Layout = layout;
         }
         else if (element.Name.LocalName == "spPr")
         {
             ExcelChartFormat format = new ExcelChartFormat();
             format.ReadXml(element, mFolder, xFile);
             this.ShapeFormat = format;
         }
         else if (element.Name.LocalName == "txPr")
         {
             ExcelTextFormat format2 = new ExcelTextFormat();
             format2.ReadXml(element, mFolder, xFile);
             this.TextForamt = format2;
         }
         else if (element.Name.LocalName == "tx")
         {
             foreach (XElement element2 in element.Elements())
             {
                 if (element2.Name.LocalName == "rich")
                 {
                     RichText text = new RichText();
                     text.ReadXml(element2, mFolder, xFile);
                     this.RichTextTitle = text;
                 }
                 else if (element2.Name.LocalName == "strRef")
                 {
                     this.TitleFormula = element2.GetChildElementValue("f");
                     if (ParsingContext.ReferenceStyle == ExcelReferenceStyle.R1C1)
                     {
                         this.TitleFormula = ParsingContext.ConvertA1FormulaToR1C1Formula(this.TitleFormula, 0, 0);
                     }
                 }
             }
         }
     }
 }
Ejemplo n.º 3
0
 internal void ReadXml(XElement node, MemoryFolder mFolder, XFile xFile)
 {
     foreach (XElement element in node.Elements())
     {
         if (element.Name.LocalName == "delete")
         {
             this.Delete = element.GetAttributeValueOrDefaultOfBooleanType("val", true);
         }
         else if (element.Name.LocalName == "idx")
         {
             this.Index = element.GetAttributeValueOrDefaultOfInt32Type("val", 0);
         }
         else if ((element.Name.LocalName != "extLst") && (element.Name.LocalName == "txPr"))
         {
             ExcelTextFormat format = new ExcelTextFormat();
             format.ReadXml(element, mFolder, xFile);
             this.TextFormat = format;
         }
     }
 }
Ejemplo n.º 4
0
        internal void ReadXml(XElement node, MemoryFolder mFolder, XFile xFile)
        {
            foreach (XElement element in node.Elements())
            {
                if (element.Name.LocalName == "axId")
                {
                    this.Id = element.GetAttributeValueOrDefaultOfInt32Type("val", 0);
                }
                else if (element.Name.LocalName == "scaling")
                {
                    Dt.Xls.Chart.Scaling scaling = new Dt.Xls.Chart.Scaling();
                    scaling.ReadXml(element);
                    this.Scaling = scaling;
                }
                else if (element.Name.LocalName == "delete")
                {
                    this.Delete = element.GetAttributeValueOrDefaultOfBooleanType("val", true);
                }
                else if (element.Name.LocalName == "axPos")
                {
                    switch (element.GetAttributeValueOrDefaultOfStringType("val", null))
                    {
                    case "b":
                        this.AxisPosition = Dt.Xls.Chart.AxisPosition.Bottom;
                        break;

                    case "l":
                        this.AxisPosition = Dt.Xls.Chart.AxisPosition.Left;
                        break;

                    case "r":
                        this.AxisPosition = Dt.Xls.Chart.AxisPosition.Right;
                        break;

                    case "t":
                        this.AxisPosition = Dt.Xls.Chart.AxisPosition.Top;
                        break;
                    }
                }
                else if (element.Name.LocalName == "majorGridlines")
                {
                    ExcelGridLine line = new ExcelGridLine();
                    line.ReadXml(element, mFolder, xFile);
                    this.MajorGridlines = line;
                }
                else if (element.Name.LocalName == "minorGridlines")
                {
                    ExcelGridLine line2 = new ExcelGridLine();
                    line2.ReadXml(element, mFolder, xFile);
                    this.MinorGridlines = line2;
                }
                else if (element.Name.LocalName == "title")
                {
                    ExcelChartTitle title = new ExcelChartTitle();
                    title.ReadXml(element, mFolder, xFile);
                    this.AxisTitle = title;
                }
                else if (element.Name.LocalName == "numFmt")
                {
                    Dt.Xls.Chart.NumberFormat format = ChartCommonSimpleNodeHelper.ReadNumberFormatNode(element);
                    this.NumberFormat       = format.NumberFormatCode;
                    this.NumberFormatLinked = format.LinkToSource;
                }
                else if (element.Name.LocalName == "majorTickMark")
                {
                    this.MajorTickMark = this.ReadTickMark(element.GetAttributeValueOrDefaultOfStringType("val", "cross"));
                }
                else if (element.Name.LocalName == "minorTickMark")
                {
                    this.MinorTickMark = this.ReadTickMark(element.GetAttributeValueOrDefaultOfStringType("val", "cross"));
                }
                else if (element.Name.LocalName == "tickLblPos")
                {
                    this.TickLabelPosition = this.ReadTickLabelPosition(element.GetAttributeValueOrDefaultOfStringType("val", "none"));
                }
                else if (element.Name.LocalName == "spPr")
                {
                    ExcelChartFormat format2 = new ExcelChartFormat();
                    format2.ReadXml(element, mFolder, xFile);
                    this.ShapeFormat = format2;
                }
                else if (element.Name.LocalName == "txPr")
                {
                    ExcelTextFormat format3 = new ExcelTextFormat();
                    format3.ReadXml(element, mFolder, xFile);
                    this.TextFormat = format3;
                }
                else if (element.Name.LocalName == "crossAx")
                {
                    this.CrossAx = element.GetAttributeValueOrDefaultOfInt32Type("val", 0);
                }
                else if (element.Name.LocalName == "crosses")
                {
                    switch (element.GetAttributeValueOrDefaultOfStringType("val", "autoZero"))
                    {
                    case "autoZero":
                        this.Crosses = AxisCrosses.AutoZero;
                        break;

                    case "max":
                        this.Crosses = AxisCrosses.Max;
                        break;

                    case "min":
                        this.Crosses = AxisCrosses.Min;
                        break;
                    }
                }
                else if (element.Name.LocalName == "crossesAt")
                {
                    this.CrosssAt = element.GetAttributeValueOrDefaultOfDoubleType("val", 0.0);
                }
                else if (element.Name.LocalName == "auto")
                {
                    this.IsAutomaticCategoryAxis = element.GetAttributeValueOrDefaultOfBooleanType("val", true);
                }
                else if (element.Name.LocalName == "lblAlgn")
                {
                    switch (element.GetAttributeValueOrDefaultOfStringType("val", "ctr"))
                    {
                    case "ctr":
                        this.LabelAlignment = Dt.Xls.Chart.LabelAlignment.Center;
                        break;

                    case "l":
                        this.LabelAlignment = Dt.Xls.Chart.LabelAlignment.Left;
                        break;

                    case "r":
                        this.LabelAlignment = Dt.Xls.Chart.LabelAlignment.Right;
                        break;
                    }
                }
                else if (element.Name.LocalName == "lblOffset")
                {
                    this.LabelOffset = element.GetAttributeValueOrDefaultOfInt32Type("val", 0);
                }
                else if (element.Name.LocalName == "tickLblSkip")
                {
                    this.TickLalelInterval = element.GetAttributeValueOrDefaultOfInt32Type("val", 0);
                }
                else if (element.Name.LocalName == "tickMarkSkip")
                {
                    this.TickMarkInterval = element.GetAttributeValueOrDefaultOfInt32Type("val", 0);
                }
                else if (element.Name.LocalName == "noMultiLvlLbl")
                {
                    this.NoMultiLevelLables = element.GetAttributeValueOrDefaultOfBooleanType("val", true);
                }
            }
        }
Ejemplo n.º 5
0
        internal void ReadXml(XElement node, MemoryFolder mFolder, XFile xFile)
        {
            foreach (XElement element in node.Elements())
            {
                if (element.Name.LocalName == "dLbl")
                {
                    ExcelDataLabel label = new ExcelDataLabel();
                    label.ReadXml(element, mFolder, xFile);
                    this.DataLabelList.Add(label);
                }
                else if (element.Name.LocalName == "delete")
                {
                    this.Delete = element.GetAttributeValueOrDefaultOfBooleanType("val", true);
                }
                else if (element.Name.LocalName == "numFmt")
                {
                    Dt.Xls.Chart.NumberFormat format = ChartCommonSimpleNodeHelper.ReadNumberFormatNode(element);
                    this.NumberFormat       = format.NumberFormatCode;
                    this.NumberFormatLinked = format.LinkToSource;
                }
                else if (element.Name.LocalName == "dLblPos")
                {
                    switch (element.GetAttributeValueOrDefaultOfStringType("val", "bestFit"))
                    {
                    case "b":
                        this.Position = DataLabelPosition.Bottom;
                        break;

                    case "bestFit":
                        this.Position = DataLabelPosition.BestFit;
                        break;

                    case "ctr":
                        this.Position = DataLabelPosition.Center;
                        break;

                    case "inBase":
                        this.Position = DataLabelPosition.InsideBase;
                        break;

                    case "inEnd":
                        this.Position = DataLabelPosition.InsideEnd;
                        break;

                    case "l":
                        this.Position = DataLabelPosition.Left;
                        break;

                    case "outEnd":
                        this.Position = DataLabelPosition.OutsideEnd;
                        break;

                    case "r":
                        this.Position = DataLabelPosition.Right;
                        break;

                    case "t":
                        this.Position = DataLabelPosition.Top;
                        break;
                    }
                }
                else if (element.Name.LocalName == "separator")
                {
                    this.Separator = element.Value;
                }
                else if (element.Name.LocalName == "showLegendKey")
                {
                    this.ShowLegendKey = element.GetAttributeValueOrDefaultOfBooleanType("val", true);
                }
                else if (element.Name.LocalName == "showVal")
                {
                    this.ShowValue = element.GetAttributeValueOrDefaultOfBooleanType("val", true);
                }
                else if (element.Name.LocalName == "showCatName")
                {
                    this.ShowCategoryName = element.GetAttributeValueOrDefaultOfBooleanType("val", true);
                }
                else if (element.Name.LocalName == "showSerName")
                {
                    this.ShowSeriesName = element.GetAttributeValueOrDefaultOfBooleanType("val", true);
                }
                else if (element.Name.LocalName == "showPercent")
                {
                    this.ShowPercentage = element.GetAttributeValueOrDefaultOfBooleanType("val", true);
                }
                else if (element.Name.LocalName == "showBubbleSize")
                {
                    this.ShowBubbleSize = element.GetAttributeValueOrDefaultOfBooleanType("val", true);
                }
                else if (element.Name.LocalName == "showLeaderLines")
                {
                    this.ShowLeaderLines = element.GetAttributeValueOrDefaultOfBooleanType("val", true);
                }
                else if (element.Name.LocalName == "leaderLines")
                {
                    foreach (XElement element2 in element.Elements())
                    {
                        if (element2.Name.LocalName == "spPr")
                        {
                            ExcelChartFormat format2 = new ExcelChartFormat();
                            format2.ReadXml(element2, mFolder, xFile);
                            this.LeaderLineFormat = format2;
                        }
                    }
                }
                else if (element.Name.LocalName == "spPr")
                {
                    ExcelChartFormat format3 = new ExcelChartFormat();
                    format3.ReadXml(element, mFolder, xFile);
                    this.ShapeFormat = format3;
                }
                else if (element.Name.LocalName == "txPr")
                {
                    ExcelTextFormat format4 = new ExcelTextFormat();
                    format4.ReadXml(element, mFolder, xFile);
                    this.TextFormat = format4;
                }
            }
            if (!this.IsShowLeaderLinesSet)
            {
                this._showLeaderLines = false;
            }
            if (!this.IsShowLegendKeySet)
            {
                this._showLegendKey = false;
            }
            if (!this.IsShowBubbleSizeSet)
            {
                this._showBubbleSize = false;
            }
            if (!this.IsShowCategoryNameSet)
            {
                this._showCategoryName = false;
            }
            if (!this.IsShowPercentageSet)
            {
                this._showPercentage = false;
            }
            if (!this.IsShowSeriesNameSet)
            {
                this._showSeriesName = false;
            }
            if (!this.IsShowValueSet)
            {
                this._showValue = false;
            }
        }
Ejemplo n.º 6
0
        internal void ReadXml(XElement node, MemoryFolder mFolder, XFile xFile)
        {
            foreach (XElement element in node.Elements())
            {
                if (element.Name.LocalName == "idx")
                {
                    this.Index = element.GetAttributeValueOrDefaultOfInt32Type("val", 0);
                }
                else if (element.Name.LocalName == "layout")
                {
                    Dt.Xls.Chart.Layout layout = new Dt.Xls.Chart.Layout();
                    layout.ReadXml(element, mFolder, xFile);
                    this.Layout = layout;
                }
                else if (element.Name.LocalName == "delete")
                {
                    this.Delete = element.GetAttributeValueOrDefaultOfBooleanType("val", true);
                }
                else if (element.Name.LocalName == "numFmt")
                {
                    Dt.Xls.Chart.NumberFormat format = ChartCommonSimpleNodeHelper.ReadNumberFormatNode(element);
                    this.NumberFormat       = format.NumberFormatCode;
                    this.NumberFormatLinked = format.LinkToSource;
                }
                else if (element.Name.LocalName == "dLblPos")
                {
                    switch (element.GetAttributeValueOrDefaultOfStringType("val", "bestFit"))
                    {
                    case "b":
                        this.Position = DataLabelPosition.Bottom;
                        break;

                    case "bestFit":
                        this.Position = DataLabelPosition.BestFit;
                        break;

                    case "ctr":
                        this.Position = DataLabelPosition.Center;
                        break;

                    case "inBase":
                        this.Position = DataLabelPosition.InsideBase;
                        break;

                    case "inEnd":
                        this.Position = DataLabelPosition.InsideEnd;
                        break;

                    case "l":
                        this.Position = DataLabelPosition.Left;
                        break;

                    case "outEnd":
                        this.Position = DataLabelPosition.OutsideEnd;
                        break;

                    case "r":
                        this.Position = DataLabelPosition.Right;
                        break;

                    case "t":
                        this.Position = DataLabelPosition.Top;
                        break;
                    }
                }
                else if (element.Name.LocalName == "separator")
                {
                    this.Separator = element.Value;
                }
                else if (element.Name.LocalName == "showLegendKey")
                {
                    this.ShowLegendKey = element.GetAttributeValueOrDefaultOfBooleanType("val", true);
                }
                else if (element.Name.LocalName == "showVal")
                {
                    this.ShowValue = element.GetAttributeValueOrDefaultOfBooleanType("val", true);
                }
                else if (element.Name.LocalName == "showCatName")
                {
                    this.ShowCategoryName = element.GetAttributeValueOrDefaultOfBooleanType("val", true);
                }
                else if (element.Name.LocalName == "showSerName")
                {
                    this.ShowSeriesName = element.GetAttributeValueOrDefaultOfBooleanType("val", true);
                }
                else if (element.Name.LocalName == "showPercent")
                {
                    this.ShowPercentage = element.GetAttributeValueOrDefaultOfBooleanType("val", true);
                }
                else if (element.Name.LocalName == "showBubbleSize")
                {
                    this.ShowBubbleSize = element.GetAttributeValueOrDefaultOfBooleanType("val", true);
                }
                else if (element.Name.LocalName == "tx")
                {
                    foreach (XElement element2 in element.Elements())
                    {
                        if (element2.Name.LocalName == "rich")
                        {
                            Dt.Xls.Chart.RichText text = new Dt.Xls.Chart.RichText();
                            text.ReadXml(element2, mFolder, xFile);
                            this.RichText = text;
                        }
                        else if (element2.Name.LocalName == "strRef")
                        {
                            this.TextFormula = element2.GetChildElementValue("f");
                            if (ParsingContext.ReferenceStyle == ExcelReferenceStyle.R1C1)
                            {
                                this.TextFormula = ParsingContext.ConvertA1FormulaToR1C1Formula(this.TextFormula, 0, 0);
                            }
                        }
                    }
                }
                else if (element.Name.LocalName == "spPr")
                {
                    ExcelChartFormat format2 = new ExcelChartFormat();
                    format2.ReadXml(element, mFolder, xFile);
                    this.ShapeFormat = format2;
                }
                else if (element.Name.LocalName == "txPr")
                {
                    ExcelTextFormat format3 = new ExcelTextFormat();
                    format3.ReadXml(element, mFolder, xFile);
                    this.TextFormat = format3;
                }
            }
        }