public void plot() { int numOfPoints = categoryData.getPointCount(); if (categoryData.isNumeric()) { CTNumData cache = retrieveNumCache(getAxDS(), categoryData); fillNumCache(cache, numOfPoints, (XDDFNumericalDataSource<?>) categoryData); } else { CTStrData cache = retrieveStrCache(getAxDS(), categoryData); fillStringCache(cache, numOfPoints, categoryData); } CTNumData cache = retrieveNumCache(getNumDS(), valuesData); fillNumCache(cache, numOfPoints, valuesData); }
public void plot(XDDFChartData data) { XSSFSheet sheet = getSheet(); for (XDDFChartData.Series series : data.getSeries()) { series.plot(); fillSheet(sheet, series.getCategoryData(), series.getValuesData()); } }
@Override default String getDataRangeReference() { return getFormula(); } }
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 replaceData(XDDFDataSource<?> category, XDDFNumericalDataSource<? extends Number> values) { if (category == null || values == null) { throw new IllegalStateException("Category and values must be defined before filling chart data."); } int numOfPoints = category.getPointCount(); if (numOfPoints != values.getPointCount()) { throw new IllegalStateException("Category and values must have the same point count."); } this.categoryData = category; this.valuesData = values; }
/** * @return axis cross type */ public AxisCrosses getCrosses() { return AxisCrosses.valueOf(getCTCrosses().getVal()); }
/** * @return major tick mark. */ public AxisTickMark getMajorTickMark() { return AxisTickMark.valueOf(getMajorCTTickMark().getVal()); }
/** * @return minor tick mark. */ public AxisTickMark getMinorTickMark() { return AxisTickMark.valueOf(getMinorCTTickMark().getVal()); }
/** * @return axis position */ public AxisPosition getPosition() { return AxisPosition.valueOf(getCTAxPos().getVal()); }
protected Series(XDDFDataSource<?> category, XDDFNumericalDataSource<? extends Number> values) { replaceData(category, values); }
protected Series(CTLineSer series, CTAxDataSource category, CTNumDataSource values) { super(XDDFDataSourcesFactory.fromDataSource(category), XDDFDataSourcesFactory.fromDataSource(values)); this.series = series; }
@Override public String getFormula() { return getDataRangeReference(); } }
public static XDDFNumericalDataSource<Double> fromNumericCellRange(XSSFSheet sheet, CellRangeAddress cellRangeAddress) { return new NumericalCellRangeDataSource(sheet, cellRangeAddress); }
@Override public String getFormula() { return getDataRangeReference(); }
/** * Create a new DrawingML manual layout. * * @param ctLayout * a DrawingML layout that should be used as base. */ public XDDFManualLayout(CTLayout ctLayout) { initializeLayout(ctLayout); }
public XDDFSeriesAxis(CTPlotArea plotArea, AxisPosition position) { initializeAxis(plotArea, position); }
public static <T extends Number> XDDFNumericalDataSource<T> fromArray(T[] elements, String dataRange, int col) { return new NumericalArrayDataSource<>(elements, dataRange, col); }
@Override public String getFormula() { return getDataRangeReference(); }
protected Series(CTScatterSer series, CTAxDataSource category, CTNumDataSource values) { super(XDDFDataSourcesFactory.fromDataSource(category), XDDFDataSourcesFactory.fromDataSource(values)); this.series = series; }
protected Series(CTBarSer series, CTAxDataSource category, CTNumDataSource values) { super(XDDFDataSourcesFactory.fromDataSource(category), XDDFDataSourcesFactory.fromDataSource(values)); this.series = series; }