// Create a new workbook Workbook workbook = new Workbook(); IWorksheet worksheet = workbook.getWorksheets().get(0); IShape shape = worksheet.getShapes().addChart(ChartType.BarClustered, 250, 20, 360, 230); worksheet.getRange("A1:D2").setValue(new Object[][]{ {100, 200, 300, 400}, {100, 200, 300, 400} }); shape.getChart().getSeriesCollection().add(worksheet.getRange("A1:D2"), RowCol.Columns); shape.getChart().getChartTitle().setText("Bar Clustered Chart"); shape.getChart().getLegend().setPosition(LegendPosition.Left); // Save to an excel file workbook.save("BarClusteredChart.xlsx");