public void deleteShapeProperties() { if (getCTPlotArea().isSetSpPr()) { getCTPlotArea().unsetSpPr(); } }
private Map<Long, XDDFValueAxis> getValueAxes() { CTPlotArea plotArea = getCTPlotArea(); int sizeOfArray = plotArea.sizeOfValAxArray(); Map<Long, XDDFValueAxis> axes = new HashMap<>(sizeOfArray); for (int i = 0; i < sizeOfArray; i++) { CTValAx values = plotArea.getValAxArray(i); axes.put(values.getAxId().getVal(), new XDDFValueAxis(values)); } return axes; }
private Map<Long, XDDFChartAxis> getCategoryAxes() { CTPlotArea plotArea = getCTPlotArea(); int sizeOfArray = plotArea.sizeOfCatAxArray(); Map<Long, XDDFChartAxis> axes = new HashMap<>(sizeOfArray); for (int i = 0; i < sizeOfArray; i++) { CTCatAx category = plotArea.getCatAxArray(i); axes.put(category.getAxId().getVal(), new XDDFCategoryAxis(category)); } return axes; }
public XDDFShapeProperties getOrAddShapeProperties() { CTPlotArea plotArea = getCTPlotArea(); CTShapeProperties properties; if (plotArea.isSetSpPr()) { properties = plotArea.getSpPr(); } else { properties = plotArea.addNewSpPr(); } return new XDDFShapeProperties(properties); }
public List<XDDFChartData> getChartSeries() { List<XDDFChartData> series = new LinkedList<>(); CTPlotArea plotArea = getCTPlotArea(); Map<Long, XDDFChartAxis> categories = getCategoryAxes(); Map<Long, XDDFValueAxis> values = getValueAxes(); for (int i = 0; i < plotArea.sizeOfBarChartArray(); i++) { CTBarChart barChart = plotArea.getBarChartArray(i); series.add(new XDDFBarChartData(barChart, categories, values)); } for (int i = 0; i < plotArea.sizeOfLineChartArray(); i++) { CTLineChart lineChart = plotArea.getLineChartArray(i); series.add(new XDDFLineChartData(lineChart, categories, values)); } for (int i = 0; i < plotArea.sizeOfPieChartArray(); i++) { CTPieChart pieChart = plotArea.getPieChartArray(i); series.add(new XDDFPieChartData(pieChart)); } for (int i = 0; i < plotArea.sizeOfRadarChartArray(); i++) { CTRadarChart radarChart = plotArea.getRadarChartArray(i); series.add(new XDDFRadarChartData(radarChart, categories, values)); } for (int i = 0; i < plotArea.sizeOfScatterChartArray(); i++) { CTScatterChart scatterChart = plotArea.getScatterChartArray(i); series.add(new XDDFScatterChartData(scatterChart, categories, values)); } // TODO repeat above code for all kind of charts return series; }
public XDDFChartData createData(ChartTypes type, XDDFChartAxis category, XDDFValueAxis values) { Map<Long, XDDFChartAxis> categories = Collections.singletonMap(category.getId(), category); Map<Long, XDDFValueAxis> mapValues = Collections.singletonMap(values.getId(), values); final CTPlotArea plotArea = getCTPlotArea(); switch (type) { case BAR: return new XDDFBarChartData(plotArea.addNewBarChart(), categories, mapValues); case LINE: return new XDDFLineChartData(plotArea.addNewLineChart(), categories, mapValues); case PIE: return new XDDFPieChartData(plotArea.addNewPieChart()); case RADAR: return new XDDFRadarChartData(plotArea.addNewRadarChart(), categories, mapValues); case SCATTER: return new XDDFScatterChartData(plotArea.addNewScatterChart(), categories, mapValues); default: return null; } }
public void deleteShapeProperties() { if (getCTPlotArea().isSetSpPr()) { getCTPlotArea().unsetSpPr(); } }
private Map<Long, XDDFValueAxis> getValueAxes() { CTPlotArea plotArea = getCTPlotArea(); int sizeOfArray = plotArea.sizeOfValAxArray(); Map<Long, XDDFValueAxis> axes = new HashMap<>(sizeOfArray); for (int i = 0; i < sizeOfArray; i++) { CTValAx values = plotArea.getValAxArray(i); axes.put(values.getAxId().getVal(), new XDDFValueAxis(values)); } return axes; }
private Map<Long, XDDFChartAxis> getCategoryAxes() { CTPlotArea plotArea = getCTPlotArea(); int sizeOfArray = plotArea.sizeOfCatAxArray(); Map<Long, XDDFChartAxis> axes = new HashMap<>(sizeOfArray); for (int i = 0; i < sizeOfArray; i++) { CTCatAx category = plotArea.getCatAxArray(i); axes.put(category.getAxId().getVal(), new XDDFCategoryAxis(category)); } return axes; }
public XDDFShapeProperties getOrAddShapeProperties() { CTPlotArea plotArea = getCTPlotArea(); CTShapeProperties properties; if (plotArea.isSetSpPr()) { properties = plotArea.getSpPr(); } else { properties = plotArea.addNewSpPr(); } return new XDDFShapeProperties(properties); }
public List<XDDFChartData> getChartSeries() { List<XDDFChartData> series = new LinkedList<>(); CTPlotArea plotArea = getCTPlotArea(); Map<Long, XDDFChartAxis> categories = getCategoryAxes(); Map<Long, XDDFValueAxis> values = getValueAxes(); for (int i = 0; i < plotArea.sizeOfBarChartArray(); i++) { CTBarChart barChart = plotArea.getBarChartArray(i); series.add(new XDDFBarChartData(barChart, categories, values)); } for (int i = 0; i < plotArea.sizeOfLineChartArray(); i++) { CTLineChart lineChart = plotArea.getLineChartArray(i); series.add(new XDDFLineChartData(lineChart, categories, values)); } for (int i = 0; i < plotArea.sizeOfPieChartArray(); i++) { CTPieChart pieChart = plotArea.getPieChartArray(i); series.add(new XDDFPieChartData(pieChart)); } for (int i = 0; i < plotArea.sizeOfRadarChartArray(); i++) { CTRadarChart radarChart = plotArea.getRadarChartArray(i); series.add(new XDDFRadarChartData(radarChart, categories, values)); } for (int i = 0; i < plotArea.sizeOfScatterChartArray(); i++) { CTScatterChart scatterChart = plotArea.getScatterChartArray(i); series.add(new XDDFScatterChartData(scatterChart, categories, values)); } // TODO repeat above code for all kind of charts return series; }
public XDDFChartData createData(ChartTypes type, XDDFChartAxis category, XDDFValueAxis values) { Map<Long, XDDFChartAxis> categories = Collections.singletonMap(category.getId(), category); Map<Long, XDDFValueAxis> mapValues = Collections.singletonMap(values.getId(), values); final CTPlotArea plotArea = getCTPlotArea(); switch (type) { case BAR: return new XDDFBarChartData(plotArea.addNewBarChart(), categories, mapValues); case LINE: return new XDDFLineChartData(plotArea.addNewLineChart(), categories, mapValues); case PIE: return new XDDFPieChartData(plotArea.addNewPieChart()); case RADAR: return new XDDFRadarChartData(plotArea.addNewRadarChart(), categories, mapValues); case SCATTER: return new XDDFScatterChartData(plotArea.addNewScatterChart(), categories, mapValues); default: return null; } }