//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.XYScatterLines, 250, 20, 360, 230); worksheet.Range["A1:B8"].Value = new object[,] { { 75, 250 }, { 50, 125 }, { 25, 375 }, { 75, 250 }, { 50, 875 }, { 25, 625 }, { 75, 750 }, { 125, 500 }, }; shape.Chart.SeriesCollection.Add(worksheet.Range["A1:B8"], GrapeCity.Documents.Excel.Drawing.RowCol.Columns); shape.Chart.ChartTitle.Text = "Scatter with Straight Lines and Markers Chart"; // Save to an excel file workbook.Save("XYScatterLinesChart.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.XYScatterLines, 250, 20, 360, 230) worksheet.Range("A1:B8").Value = New Object(,) { {75, 250}, {50, 125}, {25, 375}, {75, 250}, {50, 875}, {25, 625}, {75, 750}, {125, 500} } shape.Chart.SeriesCollection.Add(worksheet.Range("A1:B8"), RowCol.Columns) shape.Chart.ChartTitle.Text = "Scatter with Straight Lines and Markers Chart" ' save to an excel file workbook.Save("XYScatterLinesChart.xlsx")