use of org.openxmlformats.schemas.drawingml.x2006.chart.CTBubbleChart in project ocvn by devgateway.
the class XSSFBubbleChartData 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 CTBubbleChart ctBubbleChart = (CTBubbleChart) ctChart;
final CTBubbleSer bubbleSer = ctBubbleChart.addNewSer();
bubbleSer.addNewIdx().setVal(this.id);
bubbleSer.addNewOrder().setVal(this.order);
final CTAxDataSource catDS = bubbleSer.addNewXVal();
XSSFChartUtil.buildAxDataSource(catDS, this.categories);
final CTNumDataSource valueDS = bubbleSer.addNewBubbleSize();
XSSFChartUtil.buildNumDataSource(valueDS, this.values);
if (isTitleSet()) {
bubbleSer.setTx(getCTSerTx());
}
}
};
}
use of org.openxmlformats.schemas.drawingml.x2006.chart.CTBubbleChart in project oc-explorer by devgateway.
the class XSSFBubbleChartData 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 CTBubbleChart ctBubbleChart = (CTBubbleChart) ctChart;
final CTBubbleSer bubbleSer = ctBubbleChart.addNewSer();
bubbleSer.addNewIdx().setVal(this.id);
bubbleSer.addNewOrder().setVal(this.order);
final CTAxDataSource catDS = bubbleSer.addNewXVal();
XSSFChartUtil.buildAxDataSource(catDS, this.categories);
final CTNumDataSource valueDS = bubbleSer.addNewBubbleSize();
XSSFChartUtil.buildNumDataSource(valueDS, this.values);
if (isTitleSet()) {
bubbleSer.setTx(getCTSerTx());
}
}
};
}
use of org.openxmlformats.schemas.drawingml.x2006.chart.CTBubbleChart in project ocvn by devgateway.
the class XSSFBubbleChartData method fillChart.
@Override
public void fillChart(final Chart chart, final ChartAxis... axis) {
if (!(chart instanceof XSSFChart)) {
throw new IllegalArgumentException("Chart must be instance of XSSFChart");
}
final XSSFChart xssfChart = (XSSFChart) chart;
final CTPlotArea plotArea = xssfChart.getCTChart().getPlotArea();
final CTBubbleChart bubbleChart = plotArea.addNewBubbleChart();
for (CustomChartSeries s : series) {
s.addToChart(bubbleChart);
}
for (ChartAxis ax : axis) {
bubbleChart.addNewAxId().setVal(ax.getId());
}
xssfChart.setTitle(this.title);
}
use of org.openxmlformats.schemas.drawingml.x2006.chart.CTBubbleChart in project oc-explorer by devgateway.
the class XSSFBubbleChartData method fillChart.
@Override
public void fillChart(final Chart chart, final ChartAxis... axis) {
if (!(chart instanceof XSSFChart)) {
throw new IllegalArgumentException("Chart must be instance of XSSFChart");
}
final XSSFChart xssfChart = (XSSFChart) chart;
final CTPlotArea plotArea = xssfChart.getCTChart().getPlotArea();
final CTBubbleChart bubbleChart = plotArea.addNewBubbleChart();
for (CustomChartSeries s : series) {
s.addToChart(bubbleChart);
}
for (ChartAxis ax : axis) {
bubbleChart.addNewAxId().setVal(ax.getId());
}
xssfChart.setTitleText(this.title);
}
Aggregations