//create a new workbook Workbook workbook = new Workbook(); IWorksheet worksheet = workbook.getWorksheets().get(0); IShape shape = worksheet.getShapes().addChart(ChartType.LineMarkersStacked100, 250, 20, 360, 230); worksheet.getRange("A1:C5").setValue(new Object[][]{ {12, 22, 27}, {45, 52, 25}, {58, 35, 58}, {21, 37, 43}, {44, 45, 28} }); shape.getChart().getSeriesCollection().add(worksheet.getRange("A1:C5"), RowCol.Columns); shape.getChart().getChartTitle().setText("Line Marker Stacked 100 Chart"); //save to an excel file workbook.save("LineMarkerStacked100Chart.xlsx");
//create a new workbook var workbook = Workbook() val worksheet = workbook.worksheets.get(0) val shape = worksheet.shapes.addChart(ChartType.LineMarkersStacked100, 250.0, 20.0, 360.0, 230.0) worksheet.getRange("A1:C5").value = arrayOf(arrayOf(12, 22, 27), arrayOf(45, 52, 25), arrayOf(58, 35, 58), arrayOf(21, 37, 43), arrayOf(44, 45, 28)) shape.chart.seriesCollection.add(worksheet.getRange("A1:C5"), RowCol.Columns) shape.chart.chartTitle.text = "Line Marker Stacked 100 Chart" //save to an excel file workbook.save("LineMarkerStacked100Chart.xlsx")