use of org.devgateway.toolkit.web.excelcharts.CustomChartSeries in project oc-explorer by devgateway.
the class XSSFStackedBarChartData 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);
// create a stacked bar
barChart.addNewGrouping().setVal(barGrouping);
barChart.addNewOverlap().setVal((byte) OVERLAPPERCENTAGE);
// set bars orientation
barChart.addNewBarDir().setVal(barDir);
xssfChart.setTitleText(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 oc-explorer by devgateway.
the class XSSFAreaChartData 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 CTAreaChart areChart = plotArea.addNewAreaChart();
areChart.addNewVaryColors().setVal(false);
xssfChart.setTitleText(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(areChart);
}
for (ChartAxis ax : axis) {
areChart.addNewAxId().setVal(ax.getId());
}
}
use of org.devgateway.toolkit.web.excelcharts.CustomChartSeries 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);
}
use of org.devgateway.toolkit.web.excelcharts.CustomChartSeries in project oc-explorer by devgateway.
the class XSSFLineChartData 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 CTLineChart lineChart = plotArea.addNewLineChart();
lineChart.addNewVaryColors().setVal(false);
for (CustomChartSeries s : series) {
s.addToChart(lineChart);
}
for (ChartAxis ax : axis) {
lineChart.addNewAxId().setVal(ax.getId());
}
xssfChart.setTitleText(this.title);
// add grid lines
CTCatAx[] ctCatAx = plotArea.getCatAxArray();
if (ctCatAx.length != 0) {
ctCatAx[0].addNewMajorGridlines().addNewSpPr().addNewSolidFill();
}
CTValAx[] ctValAx = plotArea.getValAxArray();
if (ctValAx.length != 0) {
ctValAx[0].addNewMajorGridlines().addNewSpPr().addNewSolidFill();
}
}
use of org.devgateway.toolkit.web.excelcharts.CustomChartSeries in project oc-explorer by devgateway.
the class XSSFScatterChartData 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 CTScatterChart scatterChart = plotArea.addNewScatterChart();
addStyle(scatterChart);
for (CustomChartSeries s : series) {
s.addToChart(scatterChart);
}
for (ChartAxis ax : axis) {
scatterChart.addNewAxId().setVal(ax.getId());
}
xssfChart.setTitleText(this.title);
// add grid lines
CTCatAx[] ctCatAx = plotArea.getCatAxArray();
if (ctCatAx.length != 0) {
ctCatAx[0].addNewMajorGridlines().addNewSpPr().addNewSolidFill();
}
CTValAx[] ctValAx = plotArea.getValAxArray();
if (ctValAx.length != 0) {
ctValAx[0].addNewMajorGridlines().addNewSpPr().addNewSolidFill();
}
}
Aggregations