Exemplo n.º 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)
            : base(part)
        {
            XmlDocument doc = ConvertStreamToXml(part.GetInputStream());

            chartSpaceDocument = ChartSpaceDocument.Parse(doc, NamespaceManager);
            chart = chartSpaceDocument.GetChartSpace().chart;
        }
Exemplo n.º 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
         */
        internal XSSFChart(PackagePart part, PackageRelationship rel)
            : base(part, rel)
        {
            XmlDocument doc = ConvertStreamToXml(part.GetInputStream());

            chartSpaceDocument = ChartSpaceDocument.Parse(doc, NamespaceManager);
            chart = chartSpaceDocument.GetChartSpace().chart;
        }
Exemplo n.º 3
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();
        }
Exemplo n.º 4
0
 protected XSSFChart(PackagePart part, PackageRelationship rel)
     : base(part, rel)
 {
     this.chartSpace = ChartSpaceDocument.Parse(part.GetInputStream()).GetChartSpace();
     this.chart      = this.chartSpace.chart;
 }