Search in sources :

Example 6 with CTPieChart

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

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

Aggregations

CTPieChart (org.openxmlformats.schemas.drawingml.x2006.chart.CTPieChart)6 CTAxDataSource (org.openxmlformats.schemas.drawingml.x2006.chart.CTAxDataSource)4 CTNumDataSource (org.openxmlformats.schemas.drawingml.x2006.chart.CTNumDataSource)4 CTPieSer (org.openxmlformats.schemas.drawingml.x2006.chart.CTPieSer)4 CTPlotArea (org.openxmlformats.schemas.drawingml.x2006.chart.CTPlotArea)4 OutputStream (java.io.OutputStream)2 POIXMLDocumentPart (org.apache.poi.POIXMLDocumentPart)2 CellRangeAddress (org.apache.poi.ss.util.CellRangeAddress)2 CellReference (org.apache.poi.ss.util.CellReference)2 XSSFChart (org.apache.poi.xssf.usermodel.XSSFChart)2 XSSFRow (org.apache.poi.xssf.usermodel.XSSFRow)2 XSSFSheet (org.apache.poi.xssf.usermodel.XSSFSheet)2 XSSFWorkbook (org.apache.poi.xssf.usermodel.XSSFWorkbook)2 XmlObject (org.apache.xmlbeans.XmlObject)2 CustomChartSeries (org.devgateway.toolkit.web.excelcharts.CustomChartSeries)2 CTChart (org.openxmlformats.schemas.drawingml.x2006.chart.CTChart)2 CTNumData (org.openxmlformats.schemas.drawingml.x2006.chart.CTNumData)2 CTNumVal (org.openxmlformats.schemas.drawingml.x2006.chart.CTNumVal)2 CTSerTx (org.openxmlformats.schemas.drawingml.x2006.chart.CTSerTx)2 CTStrData (org.openxmlformats.schemas.drawingml.x2006.chart.CTStrData)2