Beispiel #1
0
        public static CT_LineChart Parse(XmlNode node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_LineChart ctObj = new CT_LineChart();

            ctObj.ser    = new List <CT_LineSer>();
            ctObj.axId   = new List <CT_UnsignedInt>();
            ctObj.extLst = new List <CT_Extension>();
            foreach (XmlNode childNode in node.ChildNodes)
            {
                if (childNode.LocalName == "grouping")
                {
                    ctObj.grouping = CT_Grouping.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "varyColors")
                {
                    ctObj.varyColors = CT_Boolean.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "dLbls")
                {
                    ctObj.dLbls = CT_DLbls.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "dropLines")
                {
                    ctObj.dropLines = CT_ChartLines.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "hiLowLines")
                {
                    ctObj.hiLowLines = CT_ChartLines.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "upDownBars")
                {
                    ctObj.upDownBars = CT_UpDownBars.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "marker")
                {
                    ctObj.marker = CT_Boolean.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "smooth")
                {
                    ctObj.smooth = CT_Boolean.Parse(childNode, namespaceManager);
                }
                else if (childNode.LocalName == "ser")
                {
                    ctObj.ser.Add(CT_LineSer.Parse(childNode, namespaceManager));
                }
                else if (childNode.LocalName == "axId")
                {
                    ctObj.axId.Add(CT_UnsignedInt.Parse(childNode, namespaceManager));
                }
                else if (childNode.LocalName == "extLst")
                {
                    ctObj.extLst.Add(CT_Extension.Parse(childNode, namespaceManager));
                }
            }
            return(ctObj);
        }
Beispiel #2
0
            internal void AddToChart(CT_LineChart ctLineChart)
            {
                CT_LineSer  ctLineSer  = ctLineChart.AddNewSer();
                CT_Grouping ctGrouping = ctLineChart.AddNewGrouping();

                ctGrouping.val = ST_Grouping.standard;
                ctLineSer.AddNewIdx().val   = (uint)id;
                ctLineSer.AddNewOrder().val = (uint)order;

                // No marker symbol on the chart line.
                ctLineSer.AddNewMarker().AddNewSymbol().val = ST_MarkerStyle.none;

                CT_AxDataSource catDS = ctLineSer.AddNewCat();

                XSSFChartUtil.BuildAxDataSource(catDS, categories);
                CT_NumDataSource valueDS = ctLineSer.AddNewVal();

                XSSFChartUtil.BuildNumDataSource(valueDS, values);

                if (IsTitleSet)
                {
                    ctLineSer.tx = GetCTSerTx();
                }

                if (fillColor != null)
                {
                    ctLineSer.spPr = new OpenXmlFormats.Dml.Chart.CT_ShapeProperties();
                    CT_LineProperties           ctLineProperties           = ctLineSer.spPr.AddNewLn();
                    CT_SolidColorFillProperties ctSolidColorFillProperties = ctLineProperties.AddNewSolidFill();
                    CT_SRgbColor ctSRgbColor = ctSolidColorFillProperties.AddNewSrgbClr();
                    ctSRgbColor.val = fillColor;
                }
            }
Beispiel #3
0
        public static CT_Area3DChart Parse(XElement node, XmlNamespaceManager namespaceManager)
        {
            if (node == null)
            {
                return(null);
            }
            CT_Area3DChart ctObj = new CT_Area3DChart();

            ctObj.ser    = new List <CT_AreaSer>();
            ctObj.axId   = new List <CT_UnsignedInt>();
            ctObj.extLst = new List <CT_Extension>();
            foreach (XElement childNode in node.ChildElements())
            {
                if (childNode.Name.LocalName == "grouping")
                {
                    ctObj.grouping = CT_Grouping.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "varyColors")
                {
                    ctObj.varyColors = CT_Boolean.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "dLbls")
                {
                    ctObj.dLbls = CT_DLbls.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "dropLines")
                {
                    ctObj.dropLines = CT_ChartLines.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "gapDepth")
                {
                    ctObj.gapDepth = CT_GapAmount.Parse(childNode, namespaceManager);
                }
                else if (childNode.Name.LocalName == "ser")
                {
                    ctObj.ser.Add(CT_AreaSer.Parse(childNode, namespaceManager));
                }
                else if (childNode.Name.LocalName == "axId")
                {
                    ctObj.axId.Add(CT_UnsignedInt.Parse(childNode, namespaceManager));
                }
                else if (childNode.Name.LocalName == "extLst")
                {
                    ctObj.extLst.Add(CT_Extension.Parse(childNode, namespaceManager));
                }
            }
            return(ctObj);
        }
Beispiel #4
0
            internal void AddToChart(CT_LineChart ctLineChart)
            {
                CT_LineSer  ctLineSer  = ctLineChart.AddNewSer();
                CT_Grouping ctGrouping = ctLineChart.AddNewGrouping();

                ctGrouping.val = ST_Grouping.standard;
                ctLineSer.AddNewIdx().val   = (uint)id;
                ctLineSer.AddNewOrder().val = (uint)order;

                // No marker symbol on the chart line.
                ctLineSer.AddNewMarker().AddNewSymbol().val = ST_MarkerStyle.none;

                CT_AxDataSource catDS = ctLineSer.AddNewCat();

                XSSFChartUtil.BuildAxDataSource(catDS, categories);
                CT_NumDataSource valueDS = ctLineSer.AddNewVal();

                XSSFChartUtil.BuildNumDataSource(valueDS, values);

                if (IsTitleSet)
                {
                    ctLineSer.tx = GetCTSerTx();
                }
            }
Beispiel #5
0
 public CT_Grouping AddNewGrouping()
 {
     this.groupingField = new CT_Grouping();
     return(this.groupingField);
 }