use of org.devgateway.toolkit.web.excelcharts.CustomChartSeries in project oc-explorer by devgateway.
the class AbstractXSSFChartData method addSeries.
@Override
public CustomChartSeries addSeries(final String title, final ChartDataSource<?> categoryAxisData, final ChartDataSource<? extends Number> values) {
if (!values.isNumeric()) {
throw new IllegalArgumentException("Value data source must be numeric.");
}
int numOfSeries = series.size();
final CustomChartSeries newSeries = createNewSerie(numOfSeries, numOfSeries, categoryAxisData, values);
if (title != null) {
newSeries.setTitle(title);
}
series.add(newSeries);
return newSeries;
}
use of org.devgateway.toolkit.web.excelcharts.CustomChartSeries in project oc-explorer by devgateway.
the class XSSFPieChartData 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 CTPieChart pieChart = plotArea.addNewPieChart();
pieChart.addNewVaryColors().setVal(true);
xssfChart.setTitleText(this.title);
for (CustomChartSeries s : series) {
s.addToChart(pieChart);
}
}
use of org.devgateway.toolkit.web.excelcharts.CustomChartSeries in project ocvn by devgateway.
the class XSSFBarChartData 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 CTBarChart barChart = plotArea.addNewBarChart();
barChart.addNewVaryColors().setVal(false);
// set bars orientation
barChart.addNewBarDir().setVal(barDir);
xssfChart.setTitle(this.title);
CTValAx[] ctValAx = plotArea.getValAxArray();
if (ctValAx.length != 0) {
ctValAx[0].addNewMajorGridlines().addNewSpPr().addNewSolidFill();
ctValAx[0].getCrossBetween().setVal(STCrossBetween.BETWEEN);
}
for (CustomChartSeries s : series) {
s.addToChart(barChart);
}
for (ChartAxis ax : axis) {
barChart.addNewAxId().setVal(ax.getId());
}
}
use of org.devgateway.toolkit.web.excelcharts.CustomChartSeries 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.devgateway.toolkit.web.excelcharts.CustomChartSeries in project ocvn by devgateway.
the class XSSFPieChartData 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 CTPieChart pieChart = plotArea.addNewPieChart();
pieChart.addNewVaryColors().setVal(true);
xssfChart.setTitle(this.title);
for (CustomChartSeries s : series) {
s.addToChart(pieChart);
}
}
Aggregations