//create a new workbook var workbook = new GrapeCity.Documents.Excel.Workbook(); IWorksheet worksheet = workbook.Worksheets[0]; GrapeCity.Documents.Excel.Drawing.IShape shape = worksheet.Shapes.AddChart(GrapeCity.Documents.Excel.Drawing.ChartType.XYScatterSmoothNoMarkers, 250, 20, 360, 230); worksheet.Range["A1:B5"].Value = new object[,] { { 4, 2 }, { 6, 1 }, { 1, 2 }, { 7, 4 }, { 4, 4 }, }; worksheet.Range["A7:B11"].Value=new object[,] { { 9, 5 }, { 7, 8 }, { 9, 8 }, { 5, 9 }, { 2, 4 }, }; shape.Chart.SeriesCollection.Add(worksheet.Range["A1:B5"], GrapeCity.Documents.Excel.Drawing.RowCol.Columns); shape.Chart.SeriesCollection.Add(worksheet.Range["A7:B11"], GrapeCity.Documents.Excel.Drawing.RowCol.Columns); shape.Chart.ChartTitle.Text = "Scatter with Smooth Lines Chart"; // Save to an excel file workbook.Save("XYScatterSmooth.xlsx");
' Create a new Workbook Dim workbook As New Workbook Dim worksheet As IWorksheet = workbook.Worksheets(0) Dim shape As IShape = worksheet.Shapes.AddChart(ChartType.XYScatterSmoothNoMarkers, 250, 20, 360, 230) worksheet.Range("A1:B5").Value = New Object(,) { {4, 2}, {6, 1}, {1, 2}, {7, 4}, {4, 4} } worksheet.Range("A7:B11").Value = New Object(,) { {9, 5}, {7, 8}, {9, 8}, {5, 9}, {2, 4} } shape.Chart.SeriesCollection.Add(worksheet.Range("A1:B5"), RowCol.Columns) shape.Chart.SeriesCollection.Add(worksheet.Range("A7:B11"), RowCol.Columns) shape.Chart.ChartTitle.Text = "Scatter with Smooth Lines Chart" ' save to an excel file workbook.Save("XYScatterSmooth.xlsx")