ExcelChartSheetDefault implements ExcelChartSheet { @Override public Chart createChartAndLegend() { final Drawing drawing = excelSheet.createDrawingPatriarch(); final ClientAnchor anchor = drawing.createAnchor(0, 0, 0, 0, 0, 5, 15, 25); final Chart chart = drawing.createChart(anchor); final ChartLegend legend = chart.getOrCreateLegend(); legend.setPosition(LegendPosition.BOTTOM); return chart; } ExcelChartSheetDefault(final Workbook workbook, final String excelSheetName); @Override void writeCell(final Object value, final Row row, final int column); @Override Row createRow(final int rowNumber); @Override Row createRow(); @Override void setColumnWidth(final int collNumber, final int size); @Override Chart createChartAndLegend(); @Override ChartDataSource<?> getCategoryChartDataSource(); @Override List<ChartDataSource<Number>> getValuesChartDataSource();  }
@Test public void createChartAndLegend() throws Exception { final ExcelChartSheet excelChartSheet = new ExcelChartSheetDefault(workbook, ChartType.pie.toString()); Chart chart = excelChartSheet.createChartAndLegend(); Assert.assertNotNull(chart); }