// Create a new workbook Workbook workbook = new Workbook(); IWorksheet worksheet = workbook.getWorksheets().get(0); IShape shape = worksheet.getShapes().addChart(ChartType.ColumnClustered, 250, 20, 360, 230); worksheet.getRange("A1:B6").setValue(new Object[][]{ {null, "S1"}, {"Item1", 10}, {"Item2", -51}, {"Item3", 52}, {"Item4", 22}, {"Item5", 23} }); shape.getChart().getSeriesCollection().add(worksheet.getRange("A1:B6"), RowCol.Columns, true, true); //set vary colors for column chart which only has one series. shape.getChart().getColumnGroups().get(0).setVaryByCategories(true); // Save to an excel file workbook.save("SetVaryColorForColumnChart.xlsx");