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());
}
}
};
}
Aggregations