// Create a new workbook Workbook workbook = new Workbook(); IWorksheet worksheet = workbook.getWorksheets().get(0); worksheet.getRange("A1:B8").setValue(new Object[][]{ {"Starting Amt", 130}, {"Measurement 1", 25}, {"Measurement 2", -75}, {"Subtotal", 80}, {"Measurement 3", 45}, {"Measurement 4", -65}, {"Measurement 5", 80}, {"Total", 140} }); worksheet.getRange("A:A").getColumns().autoFit(); //Create a waterfall chart. IShape shape = worksheet.getShapes().addChart(ChartType.Waterfall, 300, 20, 300, 250); shape.getChart().getSeriesCollection().add(worksheet.getRange("A1:B8")); //Set subtotal&total points. IPoints points = shape.getChart().getSeriesCollection().get(0).getPoints(); points.get(3).setIsTotal(true); points.get(7).setIsTotal(true); //Connector lines are not shown. ISeries series = shape.getChart().getSeriesCollection().get(0); series.setShowConnectorLines(false); //Modify the fill color of the first legend entry. ILegendEntries legendEntries = shape.getChart().getLegend().getLegendEntries(); legendEntries.get(0).getFormat().getFill().getColor().setObjectThemeColor(ThemeColor.Accent6); // Save to an excel file workbook.save("AddWaterfallChart.xlsx");