https://bz.apache.org/bugzilla/show_bug.cgi?id=64256

--- Comment #1 from Francesco Baldi <[email protected]> ---
this is the code implemented:


private Integer generateChart(XSSFSheet worksheet, String seriesChart, String
keyChart, ExcelChart excelChart, Integer indexRow, String xAxis) {
                // ExcelChart
                //
excelChart=sheetData.getClass().getAnnotation(ExcelChart.class)
                XSSFDrawing drawing = worksheet.createDrawingPatriarch();
                Integer startChart = indexRow;
                indexRow += excelChart.sizeRow();
                logger.debug("Start Chart: " + startChart);
                XSSFClientAnchor anchor = drawing.createAnchor(0, 0, 0, 0, 0,
startChart, excelChart.sizeColumn(), indexRow);

                XSSFChart chart = drawing.createChart(anchor);

                XDDFChartLegend legend = chart.getOrAddLegend();
                legend.setPosition(excelChart.legendPosition());
                XDDFCategoryAxis bottomAxis =
chart.createCategoryAxis(excelChart.categoryAxis());
                XDDFValueAxis leftAxis =
chart.createValueAxis(excelChart.valueAxis());
                logger.debug("-----------------xAxis: " + xAxis);
                XDDFDataSource<String> xs =
XDDFDataSourcesFactory.fromStringCellRange(worksheet,
CellRangeAddress.valueOf(xAxis));
                XDDFChartData chartData =
chart.createData(excelChart.chartTypes(), bottomAxis, leftAxis);
                XDDFChartData.Series series = null;
                logger.debug("------------seriesChart: " + seriesChart);
                series = chartData.addSeries(xs,
XDDFDataSourcesFactory.fromNumericCellRange(worksheet,
CellRangeAddress.valueOf(seriesChart)));
                series.setTitle(keyChart, null);
                series.setShowLeaderLines(true);

                chartData.setVaryColors(true);

                chart.plot(chartData);

                return indexRow;

        }

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to