// Create a new workbook Workbook workbook = new Workbook(); IWorksheet worksheet = workbook.getWorksheets().get(0); IShape shape = worksheet.getShapes().addChart(ChartType.Doughnut, 250, 20, 360, 230); worksheet.getRange("A1:B6").setValue(new Object[][]{ {"S1", "S2"}, {10, 25}, {51, 36}, {52, 85}, {22, 65}, {23, 69}, }); shape.getChart().getSeriesCollection().add(worksheet.getRange("A1:B6"), RowCol.Columns); shape.getChart().getChartTitle().setText("Doughnut Chart"); shape.getChart().getChartGroups().get(0).setDoughnutHoleSize(50); shape.getChart().getSeriesCollection().get(0).setHasDataLabels(true); shape.getChart().getSeriesCollection().get(1).setHasDataLabels(true); shape.getChart().getSeriesCollection().get(1).setExplosion(2); // Save to an excel file workbook.save("Pie_DoughnutChart.xlsx");