Search in sources :

Example 1 with CTBarSer

use of org.openxmlformats.schemas.drawingml.x2006.chart.CTBarSer 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)

Aggregations

XmlObject (org.apache.xmlbeans.XmlObject)1 CTAxDataSource (org.openxmlformats.schemas.drawingml.x2006.chart.CTAxDataSource)1 CTBarChart (org.openxmlformats.schemas.drawingml.x2006.chart.CTBarChart)1 CTBarSer (org.openxmlformats.schemas.drawingml.x2006.chart.CTBarSer)1 CTNumDataSource (org.openxmlformats.schemas.drawingml.x2006.chart.CTNumDataSource)1