Example #1
0
        /**
         * Construct a SpreadsheetML chart from a namespace part.
         *
         * @param part the namespace part holding the chart data,
         * the content type must be <code>application/vnd.Openxmlformats-officedocument.Drawingml.chart+xml</code>
         * @param rel  the namespace relationship holding this chart,
         * the relationship type must be http://schemas.Openxmlformats.org/officeDocument/2006/relationships/chart
         */
        protected XSSFChart(PackagePart part, PackageRelationship rel)
            : base(part, rel)
        {

            XmlDocument doc = ConvertStreamToXml(part.GetInputStream());
            chartSpaceDocument = ChartSpaceDocument.Parse(doc, NamespaceManager);
            chart = chartSpaceDocument.GetChartSpace().chart;
        }
Example #2
0
        /**
         * Construct a SpreadsheetML chart from a namespace part.
         *
         * @param part the namespace part holding the chart data,
         * the content type must be <code>application/vnd.Openxmlformats-officedocument.Drawingml.chart+xml</code>
         * @param rel  the namespace relationship holding this chart,
         * the relationship type must be http://schemas.Openxmlformats.org/officeDocument/2006/relationships/chart
         */
        protected XSSFChart(PackagePart part, PackageRelationship rel)
            : base(part, rel)
        {


            chartSpace = ChartSpaceDocument.Parse(part.GetInputStream()).GetChartSpace();
            chart = chartSpace.chart;
        }
Example #3
0
 public CT_ChartSpace()
 {
     this.extLstField = new List<CT_Extension>();
     this.userShapesField = new CT_RelId();
     this.printSettingsField = new CT_PrintSettings();
     this.externalDataField = new CT_ExternalData();
     this.txPrField = new CT_TextBody();
     this.spPrField = new CT_ShapeProperties();
     this.chartField = new CT_Chart();
     this.protectionField = new CT_Protection();
     this.pivotSourceField = new CT_PivotSource();
     this.clrMapOvrField = new CT_ColorMapping();
     this.styleField = new CT_Style();
     this.roundedCornersField = new CT_Boolean();
     this.langField = new CT_TextLanguageID();
     this.date1904Field = new CT_Boolean();
 }
Example #4
0
        /**
         * Construct a new CTChartSpace bean.
         * By default, it's just an empty placeholder for chart objects.
         *
         * @return a new CTChartSpace bean
         */
        private void CreateChart()
        {
            chartSpaceDocument = new ChartSpaceDocument();
            chart = chartSpaceDocument.GetChartSpace().AddNewChart();
            CT_PlotArea plotArea = chart.AddNewPlotArea();

            plotArea.AddNewLayout();
            chart.AddNewPlotVisOnly().val = 1;

            CT_PrintSettings printSettings = chartSpaceDocument.GetChartSpace().AddNewPrintSettings();
            printSettings.AddNewHeaderFooter();
            CT_PageMargins pageMargins = printSettings.AddNewPageMargins();
            pageMargins.b = 0.75;
            pageMargins.l = 0.70;
            pageMargins.r = 0.70;
            pageMargins.t = 0.75;
            pageMargins.header = 0.30;
            pageMargins.footer = 0.30;
            printSettings.AddNewPageSetup();
        }
Example #5
0
 public CT_Chart AddNewChart()
 {
     this.chartField=new CT_Chart();
     return this.chartField;
 }
Example #6
0
 public static CT_Chart Parse(XmlNode node, XmlNamespaceManager namespaceManager)
 {
     if (node == null)
         return null;
     CT_Chart ctObj = new CT_Chart();
     ctObj.pivotFmts = new List<CT_PivotFmt>();
     ctObj.extLst = new List<CT_Extension>();
     foreach (XmlNode childNode in node.ChildNodes)
     {
         if (childNode.LocalName == "title")
             ctObj.title = CT_Title.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "autoTitleDeleted")
             ctObj.autoTitleDeleted = CT_Boolean.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "view3D")
             ctObj.view3D = CT_View3D.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "floor")
             ctObj.floor = CT_Surface.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "sideWall")
             ctObj.sideWall = CT_Surface.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "backWall")
             ctObj.backWall = CT_Surface.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "plotArea")
             ctObj.plotArea = CT_PlotArea.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "legend")
             ctObj.legend = CT_Legend.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "plotVisOnly")
             ctObj.plotVisOnly = CT_Boolean.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "dispBlanksAs")
             ctObj.dispBlanksAs = CT_DispBlanksAs.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "showDLblsOverMax")
             ctObj.showDLblsOverMax = CT_Boolean.Parse(childNode, namespaceManager);
         else if (childNode.LocalName == "pivotFmts")
             ctObj.pivotFmts.Add(CT_PivotFmt.Parse(childNode, namespaceManager));
         else if (childNode.LocalName == "extLst")
             ctObj.extLst.Add(CT_Extension.Parse(childNode, namespaceManager));
     }
     return ctObj;
 }