use of org.apache.xmlbeans.XmlObject 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());
}
}
};
}
use of org.apache.xmlbeans.XmlObject 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());
}
}
};
}
Aggregations