Search in sources :

Example 1 with CTScatterSer

use of org.openxmlformats.schemas.drawingml.x2006.chart.CTScatterSer 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)1 CTAxDataSource (org.openxmlformats.schemas.drawingml.x2006.chart.CTAxDataSource)1 CTNumDataSource (org.openxmlformats.schemas.drawingml.x2006.chart.CTNumDataSource)1 CTScatterChart (org.openxmlformats.schemas.drawingml.x2006.chart.CTScatterChart)1 CTScatterSer (org.openxmlformats.schemas.drawingml.x2006.chart.CTScatterSer)1