// Create a new workbook Workbook workbook = new Workbook(); IWorksheet worksheet = workbook.getWorksheets().get(0); IShape shape = worksheet.getShapes().addChart(ChartType.BarStacked100, 250, 20, 360, 230); worksheet.getRange("A1:B5").setValue(new Object[][]{ {1, 5}, {2, 4}, {3, 3}, {4, 2}, {4, 1} }); shape.getChart().getSeriesCollection().add(worksheet.getRange("A1:B5"), RowCol.Columns); shape.getChart().getChartTitle().setText("Bar Stacked 100 Chart"); shape.getChart().getLegend().setPosition(LegendPosition.Left); // Save to an excel file workbook.save("BarStacked100Chart.xlsx");