Search in sources :

Example 1 with CTAreaSer

use of org.openxmlformats.schemas.drawingml.x2006.chart.CTAreaSer in project ocvn by devgateway.

the class XSSFAreaChartData 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 CTAreaChart ctAreaChart = (CTAreaChart) ctChart;
            final CTAreaSer ctAreaSer = ctAreaChart.addNewSer();
            ctAreaSer.addNewIdx().setVal(this.id);
            ctAreaSer.addNewOrder().setVal(this.order);
            final CTAxDataSource catDS = ctAreaSer.addNewCat();
            XSSFChartUtil.buildAxDataSource(catDS, this.categories);
            final CTNumDataSource valueDS = ctAreaSer.addNewVal();
            XSSFChartUtil.buildNumDataSource(valueDS, this.values);
            if (isTitleSet()) {
                ctAreaSer.setTx(getCTSerTx());
            }
        }
    };
}
Also used : CTNumDataSource(org.openxmlformats.schemas.drawingml.x2006.chart.CTNumDataSource) CTAreaChart(org.openxmlformats.schemas.drawingml.x2006.chart.CTAreaChart) CTAreaSer(org.openxmlformats.schemas.drawingml.x2006.chart.CTAreaSer) XmlObject(org.apache.xmlbeans.XmlObject) CTAxDataSource(org.openxmlformats.schemas.drawingml.x2006.chart.CTAxDataSource)

Example 2 with CTAreaSer

use of org.openxmlformats.schemas.drawingml.x2006.chart.CTAreaSer in project oc-explorer by devgateway.

the class XSSFAreaChartData 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 CTAreaChart ctAreaChart = (CTAreaChart) ctChart;
            final CTAreaSer ctAreaSer = ctAreaChart.addNewSer();
            ctAreaSer.addNewIdx().setVal(this.id);
            ctAreaSer.addNewOrder().setVal(this.order);
            final CTAxDataSource catDS = ctAreaSer.addNewCat();
            XSSFChartUtil.buildAxDataSource(catDS, this.categories);
            final CTNumDataSource valueDS = ctAreaSer.addNewVal();
            XSSFChartUtil.buildNumDataSource(valueDS, this.values);
            if (isTitleSet()) {
                ctAreaSer.setTx(getCTSerTx());
            }
        }
    };
}
Also used : CTNumDataSource(org.openxmlformats.schemas.drawingml.x2006.chart.CTNumDataSource) CTAreaChart(org.openxmlformats.schemas.drawingml.x2006.chart.CTAreaChart) CTAreaSer(org.openxmlformats.schemas.drawingml.x2006.chart.CTAreaSer) XmlObject(org.apache.xmlbeans.XmlObject) CTAxDataSource(org.openxmlformats.schemas.drawingml.x2006.chart.CTAxDataSource)

Aggregations

XmlObject (org.apache.xmlbeans.XmlObject)2 CTAreaChart (org.openxmlformats.schemas.drawingml.x2006.chart.CTAreaChart)2 CTAreaSer (org.openxmlformats.schemas.drawingml.x2006.chart.CTAreaSer)2 CTAxDataSource (org.openxmlformats.schemas.drawingml.x2006.chart.CTAxDataSource)2 CTNumDataSource (org.openxmlformats.schemas.drawingml.x2006.chart.CTNumDataSource)2