Search in sources :

Example 86 with XmlObject

use of org.apache.xmlbeans.XmlObject in project ocvn by devgateway.

the class XSSFBarChartData method createNewSerie.

@Override
protected CustomChartSeries createNewSerie(final int id, final int order, final ChartDataSource<?> categories, final ChartDataSource<? extends Number> values) {
    return new AbstractSeries(id, order, categories, values) {

        @Override
        public void addToChart(final XmlObject ctChart) {
            final CTBarChart ctBarChart = (CTBarChart) ctChart;
            final CTBarSer ctBarSer = ctBarChart.addNewSer();
            ctBarSer.addNewIdx().setVal(this.id);
            ctBarSer.addNewOrder().setVal(this.order);
            final CTAxDataSource catDS = ctBarSer.addNewCat();
            XSSFChartUtil.buildAxDataSource(catDS, this.categories);
            final CTNumDataSource valueDS = ctBarSer.addNewVal();
            XSSFChartUtil.buildNumDataSource(valueDS, this.values);
            if (isTitleSet()) {
                ctBarSer.setTx(getCTSerTx());
            }
        }
    };
}
Also used : CTNumDataSource(org.openxmlformats.schemas.drawingml.x2006.chart.CTNumDataSource) CTBarSer(org.openxmlformats.schemas.drawingml.x2006.chart.CTBarSer) XmlObject(org.apache.xmlbeans.XmlObject) CTBarChart(org.openxmlformats.schemas.drawingml.x2006.chart.CTBarChart) CTAxDataSource(org.openxmlformats.schemas.drawingml.x2006.chart.CTAxDataSource)

Example 87 with XmlObject

use of org.apache.xmlbeans.XmlObject in project ocvn by devgateway.

the class XSSFScatterChartData method createNewSerie.

@Override
protected CustomChartSeries createNewSerie(final int id, final int order, final ChartDataSource<?> categories, final ChartDataSource<? extends Number> values) {
    return new AbstractSeries(id, order, categories, values) {

        @Override
        public void addToChart(final XmlObject ctChart) {
            final CTScatterChart ctScatterChart = (CTScatterChart) ctChart;
            final CTScatterSer scatterSer = ctScatterChart.addNewSer();
            scatterSer.addNewIdx().setVal(this.id);
            scatterSer.addNewOrder().setVal(this.order);
            final CTAxDataSource catDS = scatterSer.addNewXVal();
            XSSFChartUtil.buildAxDataSource(catDS, this.categories);
            final CTNumDataSource valueDS = scatterSer.addNewYVal();
            XSSFChartUtil.buildNumDataSource(valueDS, this.values);
            if (isTitleSet()) {
                scatterSer.setTx(getCTSerTx());
            }
        }
    };
}
Also used : CTScatterChart(org.openxmlformats.schemas.drawingml.x2006.chart.CTScatterChart) CTNumDataSource(org.openxmlformats.schemas.drawingml.x2006.chart.CTNumDataSource) CTScatterSer(org.openxmlformats.schemas.drawingml.x2006.chart.CTScatterSer) XmlObject(org.apache.xmlbeans.XmlObject) CTAxDataSource(org.openxmlformats.schemas.drawingml.x2006.chart.CTAxDataSource)

Aggregations

XmlObject (org.apache.xmlbeans.XmlObject)87 XmlCursor (org.apache.xmlbeans.XmlCursor)42 Test (org.junit.Test)14 XmlException (org.apache.xmlbeans.XmlException)13 CTTbl (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTTbl)13 DefaultExchange (org.apache.camel.impl.DefaultExchange)10 DefaultCamelContext (org.apache.camel.impl.DefaultCamelContext)9 CTP (org.openxmlformats.schemas.wordprocessingml.x2006.main.CTP)9 CTPicture (org.openxmlformats.schemas.presentationml.x2006.main.CTPicture)7 POIXMLException (org.apache.poi.POIXMLException)6 CTAxDataSource (org.openxmlformats.schemas.drawingml.x2006.chart.CTAxDataSource)6 CTNumDataSource (org.openxmlformats.schemas.drawingml.x2006.chart.CTNumDataSource)6 CTShapeProperties (org.openxmlformats.schemas.drawingml.x2006.main.CTShapeProperties)6 CTGroupShape (org.openxmlformats.schemas.presentationml.x2006.main.CTGroupShape)6 ArrayList (java.util.ArrayList)5 QName (javax.xml.namespace.QName)5 CTGraphicalObjectFrame (org.openxmlformats.schemas.presentationml.x2006.main.CTGraphicalObjectFrame)5 Node (org.w3c.dom.Node)5 CTConnector (org.openxmlformats.schemas.presentationml.x2006.main.CTConnector)4 CTShape (org.openxmlformats.schemas.presentationml.x2006.main.CTShape)4